Re: perf: bug, kernel ignores the buffer size on large read

2015-09-02 Thread Vince Weaver
On Thu, 3 Sep 2015, Peter Zijlstra wrote: > I think we should try and just ban events with a read_size > 64k; that's > one _large_ group -- there's other issues with that as well I imagine. yes, I don't really have a use case for this, I just noticed the problem because Debian apparently bumped

Re: perf: bug, kernel ignores the buffer size on large read

2015-09-02 Thread Peter Zijlstra
On Wed, Sep 02, 2015 at 12:34:41PM -0400, Vince Weaver wrote: > > OK, this time I found the actual bug. > > event->read_size is declared as a u16 in include/linux/perf_event.h > > but it is very easy to get event->read_size larger than 64k > (in my case, create 1 events in a group). > > Bec

perf: bug, kernel ignores the buffer size on large read

2015-09-02 Thread Vince Weaver
OK, this time I found the actual bug. event->read_size is declared as a u16 in include/linux/perf_event.h but it is very easy to get event->read_size larger than 64k (in my case, create 1 events in a group). Because we wrap around the u16, the if (count < event->read_size) return