summaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2024-09-09 11:08:06 +0200
committerJohannes Berg <johannes.berg@intel.com>2024-09-09 11:43:21 +0200
commit15ea13b1b1fbf6364d4cd568e65e4c8479632999 (patch)
tree73a1e7edba1f4611341238c18c3322309d7f03f4 /net/wireless/sme.c
parentwifi: cfg80211: fix kernel-doc for per-link data (diff)
downloadlinux-15ea13b1b1fbf6364d4cd568e65e4c8479632999.tar.xz
linux-15ea13b1b1fbf6364d4cd568e65e4c8479632999.zip
wifi: cfg80211: fix two more possible UBSAN-detected off-by-one errors
Although not reproduced in practice, these two cases may be considered by UBSAN as off-by-one errors. So fix them in the same way as in commit a26a5107bc52 ("wifi: cfg80211: fix UBSAN noise in cfg80211_wext_siwscan()"). Fixes: 807f8a8c3004 ("cfg80211/nl80211: add support for scheduled scans") Fixes: 5ba63533bbf6 ("cfg80211: fix alignment problem in scan request") Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Link: https://patch.msgid.link/20240909090806.1091956-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index d9d7bf8bb5c1..431da30817a6 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -115,7 +115,8 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
n_channels = i;
}
request->n_channels = n_channels;
- request->ssids = (void *)&request->channels[n_channels];
+ request->ssids = (void *)request +
+ struct_size(request, channels, n_channels);
request->n_ssids = 1;
memcpy(request->ssids[0].ssid, wdev->conn->params.ssid,