Re: [patch] perf: potential underflow in perf_sample_ustack_size()

2013-09-21 Thread Jiri Olsa
On Fri, Sep 20, 2013 at 02:37:36PM +0300, Dan Carpenter wrote: > The code here is trying to ensure that we don't have a > "header_size + stack_size" which is more than USHRT_MAX. I changed > the overflow check a little to make it more clear. > > My concern here is that if "header_size + sizeof(u6

[patch] perf: potential underflow in perf_sample_ustack_size()

2013-09-20 Thread Dan Carpenter
The code here is trying to ensure that we don't have a "header_size + stack_size" which is more than USHRT_MAX. I changed the overflow check a little to make it more clear. My concern here is that if "header_size + sizeof(u64)" is very large then we could end up with underflow doing the subtracti