Skip to content

Commit 0016d32

Browse files
committed
nl80211: fix NL80211_ATTR_CHANNEL_WIDTH attribute type
The new opmode notification used this attribute with a u8, when it's documented as a u32 and indeed used in userspace as such, it just happens to work on little-endian systems since userspace isn't doing any strict size validation, and the u8 goes into the lower byte. Fix this. Cc: [email protected] Fixes: 466b993 ("cfg80211: Add support to notify station's opmode change to userspace") Signed-off-by: Johannes Berg <[email protected]> Link: https://lore.kernel.org/r/20200325090531.be124f0a11c7.Iedbf4e197a85471ebd729b186d5365c0343bf7a8@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 2de9780 commit 0016d32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/wireless/nl80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16416,7 +16416,7 @@ void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
1641616416
goto nla_put_failure;
1641716417

1641816418
if ((sta_opmode->changed & STA_OPMODE_MAX_BW_CHANGED) &&
16419-
nla_put_u8(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw))
16419+
nla_put_u32(msg, NL80211_ATTR_CHANNEL_WIDTH, sta_opmode->bw))
1642016420
goto nla_put_failure;
1642116421

1642216422
if ((sta_opmode->changed & STA_OPMODE_N_SS_CHANGED) &&

0 commit comments

Comments
 (0)