Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-05-07 Thread Nathan Chancellor
On Tue, May 07, 2024 at 12:46:46PM +0200, Johannes Berg wrote: > On Thu, 2024-04-25 at 11:13 -0700, Nathan Chancellor wrote: > > On Wed, Apr 24, 2024 at 03:01:01PM -0700, Kees Cook wrote: > > > Before request->channels[] can be used, request->n_channels must be set. > > > Additionally, address calc

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-05-07 Thread Johannes Berg
On Thu, 2024-04-25 at 11:13 -0700, Nathan Chancellor wrote: > On Wed, Apr 24, 2024 at 03:01:01PM -0700, Kees Cook wrote: > > Before request->channels[] can be used, request->n_channels must be set. > > Additionally, address calculations for memory after the "channels" array > > need to be calculate

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-04-30 Thread Kees Cook
On Tue, Apr 30, 2024 at 12:59:57PM -0700, Jeff Johnson wrote: > On 4/30/2024 3:01 AM, Johannes Berg wrote: > > This really doesn't even seem right, shouldn't do pointer arithmetic on > > void pointers. > > FWIW I argued this in the past in another context and Linus gave his opinion: > > https://l

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-04-30 Thread Jeff Johnson
On 4/30/2024 3:01 AM, Johannes Berg wrote: > This really doesn't even seem right, shouldn't do pointer arithmetic on > void pointers. FWIW I argued this in the past in another context and Linus gave his opinion: https://lore.kernel.org/all/CAHk-=whFKYMrF6euVvziW+drw7-yi1pYdf=uccnzj8k09do...@mail.

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-04-30 Thread Johannes Berg
On Wed, 2024-04-24 at 15:01 -0700, Kees Cook wrote: > Before request->channels[] can be used, request->n_channels must be set. > Additionally, address calculations for memory after the "channels" array > need to be calculated from the allocation base ("request") rather than > via the first "out of

Re: [PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-04-25 Thread Nathan Chancellor
On Wed, Apr 24, 2024 at 03:01:01PM -0700, Kees Cook wrote: > Before request->channels[] can be used, request->n_channels must be set. > Additionally, address calculations for memory after the "channels" array > need to be calculated from the allocation base ("request") rather than > via the first "

[PATCH] wifi: nl80211: Avoid address calculations via out of bounds array indexing

2024-04-24 Thread Kees Cook
Before request->channels[] can be used, request->n_channels must be set. Additionally, address calculations for memory after the "channels" array need to be calculated from the allocation base ("request") rather than via the first "out of bounds" index of "channels", otherwise run-time bounds check