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: <7e2745d9-f607-4b9b-87c6-0623708747ef@embeddedor.com>
Date: Fri, 25 Oct 2024 15:10:11 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Johannes Berg <johannes@...solutions.net>,
 "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-hardening@...r.kernel.org, Aditya Kumar Singh <quic_adisi@...cinc.com>
Subject: Re: [PATCH][next] wifi: mac80211: ieee80211_i: Avoid dozens of
 -Wflex-array-member-not-at-end warnings



On 25/10/24 14:48, Johannes Berg wrote:
> On Fri, 2024-10-25 at 14:36 -0600, Gustavo A. R. Silva wrote:
>>>>
>>>> Yeah, I was actually going to mention this commit, as it's the one that introduced
>>>> that `bool radar_detected` to the flex struct. However, it wasn't obvious to me
>>>> how `struct ieee80211_chanctx_conf conf` could overwrite `radar_detected` as I didn't
>>>> see `conf->drv_priv` being accessed through `struct struct ieee80211_chanctx_conf`.
>>>
>>> You have to look at the drivers, see hwsim_clear_chanctx_magic() for
>>> example; I wonder why hwsim_check_chanctx_magic() never caught this.
>>
>> Sorry, I actually meant through `struct ieee80211_chanctx`. Something like:
>>
>> struct ieee80211_chanctx *foo;
>> ...
>>
>> foo->conf.drv_priv[i] = something;
>>
>> or
>>
>> struct bar *ptr = (void *)foo->conf->drv_priv;
>> then write something into *ptr...
>>
>> In the above cases the code will indeed overwrite `radar_detected`.
> 
> Right, that's what it does though, no? Except it doesn't have, in the
> driver, "foo->conf." because mac80211 only gives it a pointer to conf,
> so it's only "conf->drv_priv" (and it's the "struct bar" example.)

OK, so do you mean that pointer to `conf` is actually coming from
`foo->conf`?

This is probably a dumb question but, where is that pointer to `conf`
coming from exactly?

I'd really like to understand this better so I can determine whether
I'm dealing with a bug when analyzing similar instances in the future. :)

> 
> So yeah, pretty sure it will overwrite that, and I do wonder why it
> wasn't caught. I guess no radar detection tests with MLO yet.
> 

--
Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ