[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7aufdhkqug3bvwlgl727k3ga2mnu3lcgyj3enkl3kjub235q75@rjfmkktmpsi2>
Date: Mon, 26 Jun 2023 07:59:16 +0000
From: Naohiro Aota <Naohiro.Aota@....com>
To: Julia Lawall <Julia.Lawall@...ia.fr>
CC: Chris Mason <clm@...com>,
"keescook@...omium.org" <keescook@...omium.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 12/26] btrfs: zoned: use array_size
On Fri, Jun 23, 2023 at 11:14:43PM +0200, Julia Lawall wrote:
> Use array_size to protect against multiplication overflows.
>
> The changes were done using the following Coccinelle semantic patch:
>
> // <smpl>
> @@
> size_t e1,e2;
> expression COUNT;
> identifier alloc = {vmalloc,vzalloc,kvmalloc,kvzalloc};
> @@
>
> (
> alloc(
> - (e1) * (e2)
> + array_size(e1, e2)
> ,...)
> |
> alloc(
> - (e1) * (COUNT)
> + array_size(COUNT, e1)
> ,...)
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@...ia.fr>
Looks good.
Reviewed-by: Naohiro Aota <naohiro.aota@....com>
Powered by blists - more mailing lists