mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
cf44e74504
Move the `struct ieee80211_chanctx_conf conf` to the end of
`struct ieee80211_chanctx` and fix a memory corruption bug
triggered e.g. in `hwsim_set_chanctx_magic()`: `radar_detected`
is being overwritten when `cp->magic = HWSIM_CHANCTX_MAGIC;`
See the function call sequence below:
drv_add_chanctx(... struct ieee80211_chanctx *ctx) ->
local->ops->add_chanctx(&local->hw, &ctx->conf) ->
mac80211_hwsim_add_chanctx(... struct ieee80211_chanctx_conf *ctx) ->
hwsim_set_chanctx_magic(ctx)
This also happens in a number of other drivers.
Also, add a code comment to try to prevent people from introducing
new members after `struct ieee80211_chanctx_conf conf`. Notice that
`struct ieee80211_chanctx_conf` is a flexible structure --a structure
that contains a flexible-array member, so it should always be at
the end of any other containing structures.
This change also fixes 50 of the following warnings:
net/mac80211/ieee80211_i.h:895:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.
Fixes:
|
||
---|---|---|
.. | ||
tests | ||
aead_api.c | ||
aead_api.h | ||
aes_ccm.h | ||
aes_cmac.c | ||
aes_cmac.h | ||
aes_gcm.h | ||
aes_gmac.c | ||
aes_gmac.h | ||
agg-rx.c | ||
agg-tx.c | ||
airtime.c | ||
cfg.c | ||
chan.c | ||
debug.h | ||
debugfs_key.c | ||
debugfs_key.h | ||
debugfs_netdev.c | ||
debugfs_netdev.h | ||
debugfs_sta.c | ||
debugfs_sta.h | ||
debugfs.c | ||
debugfs.h | ||
driver-ops.c | ||
driver-ops.h | ||
drop.h | ||
eht.c | ||
ethtool.c | ||
fils_aead.c | ||
fils_aead.h | ||
he.c | ||
ht.c | ||
ibss.c | ||
ieee80211_i.h | ||
iface.c | ||
Kconfig | ||
key.c | ||
key.h | ||
led.c | ||
led.h | ||
link.c | ||
main.c | ||
Makefile | ||
mesh_hwmp.c | ||
mesh_pathtbl.c | ||
mesh_plink.c | ||
mesh_ps.c | ||
mesh_sync.c | ||
mesh.c | ||
mesh.h | ||
michael.c | ||
michael.h | ||
mlme.c | ||
ocb.c | ||
offchannel.c | ||
parse.c | ||
pm.c | ||
rate.c | ||
rate.h | ||
rc80211_minstrel_ht_debugfs.c | ||
rc80211_minstrel_ht.c | ||
rc80211_minstrel_ht.h | ||
rx.c | ||
s1g.c | ||
scan.c | ||
spectmgmt.c | ||
sta_info.c | ||
sta_info.h | ||
status.c | ||
tdls.c | ||
tkip.c | ||
tkip.h | ||
trace_msg.h | ||
trace.c | ||
trace.h | ||
tx.c | ||
util.c | ||
vht.c | ||
wbrf.c | ||
wep.c | ||
wep.h | ||
wme.c | ||
wme.h | ||
wpa.c | ||
wpa.h |