Skip to content
Commit 838c7b8f authored by Kees Cook's avatar Kees Cook Committed by Johannes Berg
Browse files

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



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 checking will throw a warning.

Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
Fixes: e3eac9f3 ("wifi: cfg80211: Annotate struct cfg80211_scan_request with __counted_by")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://msgid.link/20240424220057.work.819-kees@kernel.org


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 3d913719
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment