mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-07 18:05:21 +02:00
wifi: cfg80211: fix two more possible UBSAN-detected off-by-one errors
[ Upstream commit15ea13b1b1
] 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 commita26a5107bc
("wifi: cfg80211: fix UBSAN noise in cfg80211_wext_siwscan()"). Fixes:807f8a8c30
("cfg80211/nl80211: add support for scheduled scans") Fixes:5ba63533bb
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2780657f7f
commit
cacdc11898
|
@ -9679,7 +9679,8 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
if (n_ssids)
|
if (n_ssids)
|
||||||
request->ssids = (void *)&request->channels[n_channels];
|
request->ssids = (void *)request +
|
||||||
|
struct_size(request, channels, n_channels);
|
||||||
request->n_ssids = n_ssids;
|
request->n_ssids = n_ssids;
|
||||||
if (ie_len) {
|
if (ie_len) {
|
||||||
if (n_ssids)
|
if (n_ssids)
|
||||||
|
|
|
@ -115,7 +115,8 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
|
||||||
n_channels = i;
|
n_channels = i;
|
||||||
}
|
}
|
||||||
request->n_channels = n_channels;
|
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;
|
request->n_ssids = 1;
|
||||||
|
|
||||||
memcpy(request->ssids[0].ssid, wdev->conn->params.ssid,
|
memcpy(request->ssids[0].ssid, wdev->conn->params.ssid,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user