Re: [PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-19 Thread Len Baker
Hi Dexuan, On Sat, Sep 18, 2021 at 05:06:16PM +, Dexuan Cui wrote: > > From: Len Baker > > Sent: Saturday, September 18, 2021 6:20 AM > > ... > > I have received a email from the linux-media subsystem telling that this > > patch is not applicable. The email is the following: > > > > Regards,

Re: [PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-18 Thread Len Baker
Hi Kees, On Sat, Sep 18, 2021 at 06:51:51AM -0700, Kees Cook wrote: > > > On September 18, 2021 6:20:10 AM PDT, Len Baker wrote: > >Hi, > > > >On Sat, Sep 11, 2021 at 12:28:18PM +0200, Len Baker wrote: > >> As noted in the "Deprecated Interfaces, Language Features, Attributes, > >> and Convention

RE: [PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-18 Thread Dexuan Cui
> From: Len Baker > Sent: Saturday, September 18, 2021 6:20 AM > ... > I have received a email from the linux-media subsystem telling that this > patch is not applicable. The email is the following: > > Regards, > Len The patch is already in the net-next tree: https://git.kernel.org/pub/scm/lin

Re: [PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-18 Thread Kees Cook
On September 18, 2021 6:20:10 AM PDT, Len Baker wrote: >Hi, > >On Sat, Sep 11, 2021 at 12:28:18PM +0200, Len Baker wrote: >> As noted in the "Deprecated Interfaces, Language Features, Attributes, >> and Conventions" documentation [1], size calculations (especially >> multiplication) should not

Re: [PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-18 Thread Len Baker
Hi, On Sat, Sep 11, 2021 at 12:28:18PM +0200, Len Baker wrote: > As noted in the "Deprecated Interfaces, Language Features, Attributes, > and Conventions" documentation [1], size calculations (especially > multiplication) should not be performed in memory allocator (or similar) > function argument

RE: [PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-11 Thread Haiyang Zhang
Cc: Len Baker ; Colin Ian King > ; linux-harden...@vger.kernel.org; linux- > hyp...@vger.kernel.org; net...@vger.kernel.org; linux- > ker...@vger.kernel.org; linux-me...@vger.kernel.org; dri- > de...@lists.freedesktop.org; linaro-mm-...@lists.linaro.org > Subject: [PATCH]

[PATCH] net: mana: Prefer struct_size over open coded arithmetic

2021-09-11 Thread Len Baker
As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrappin