lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN6PR04MB45270B6B0A4EDE903568A29E86040@SN6PR04MB4527.namprd04.prod.outlook.com>
Date:   Sat, 18 May 2019 00:43:46 +0000
From:   Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>
To:     "xiaolinkui <xiaolinkui@...inos.cn> Jens Axboe" <axboe@...nel.dk>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] block: bio: use struct_size() in kmalloc()

- linux-block@...r.kernel.org <linux-block@...r.kernel.org> to reduce
the noise.

I apologies Jens, I didn't apply and tested these patches before
submitting the
review and assumed that patches are compiled and tested, I'll do so for each
patch before submitting the review.

Xiaolinkui,

Please send compiled and tested patch only on the latest kernel on the
appropriate subsystem, otherwise mark the patch appropriately
[RFC/Compile only] so reviewer would know without such a tag
it is easy to assume that patch is compiled and tested.

You have also sent out the couple of more patches with this fix.

If they are not compiled and tested with right kernel branch for each
subsystem, please update the appropriate mail thread either to ignore those
patches (if they have compilation problem on appropriate branch) or mark
them compile test only (this needs to be avoided for these patches), in
either
case please send updated patches for this fix if needed.

Thanks.

On 5/17/19 3:59 PM, Jens Axboe wrote:
> On 5/17/19 3:17 PM, Jens Axboe wrote:
>> On 5/17/19 3:12 AM, xiaolinkui wrote:
>>> One of the more common cases of allocation size calculations is finding
>>> the size of a structure that has a zero-sized array at the end, along
>>> with memory for some number of elements for that array. For example:
>>>
>>> struct foo {
>>>     int stuff;
>>>     struct boo entry[];
>>> };
>>>
>>> instance = kmalloc(sizeof(struct foo) + count * sizeof(struct boo), GFP_KERNEL);
>>>
>>> Instead of leaving these open-coded and prone to type mistakes, we can
>>> now use the new struct_size() helper:
>>>
>>> instance = kmalloc(struct_size(instance, entry, count), GFP_KERNEL);
>> Applied, thanks.
> I take that back, you obviously didn't even compile this patch. Never
> send untested crap, without explicitly saying so.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ