Re: [PATCH v2] blkparse: Avoid segfault for wrong cpu number.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-05-25 17:49, Tao Ma wrote:
> From: Tao Ma <boyu.mt@xxxxxxxxxx>
> 
> Currently we only check the magic number to see whether
> a blktrace is valid or not, but Bill Broadley did meet
> with a case that the cpu info is wrong with a number
> of 1725552676. So in resize_cpu_info, we meet with a
> overflow when calculating
> size = new_count * sizeof(struct per_cpu_info);
> And the program will be either segfault or has the error
> of out of memory. Although this is more likely a kernel
> problem, the blkparse shoudn't segfault for it.
> 
> So this patch just check whether the cpu stored in the
> trace is the same as the file, if not, just warn it out
> and skip it.

Being a bit conservative doesn't hurt. Applied.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-btrace" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux