]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size
authorJohannes Berg <johannes.berg@intel.com>
Mon, 11 Apr 2022 09:42:03 +0000 (11:42 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 10:01:02 +0000 (12:01 +0200)
commit1bc096e87d185c621724c894f000bc643b7444a6
tree65492697ad25f139ef27a93385b0d7d78db5735c
parent55624cb8dc16af81f4235f668314f9c73a53e284
nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size

BugLink: https://bugs.launchpad.net/bugs/1969857
commit 6624bb34b4eb19f715db9908cca00122748765d7 upstream.

We need this to be at least two bytes, so we can access
alpha2[0] and alpha2[1]. It may be three in case some
userspace used NUL-termination since it was NLA_STRING
(and we also push it out with NUL-termination).

Cc: stable@vger.kernel.org
Reported-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220411114201.fd4a31f06541.Ie7ff4be2cf348d8cc28ed0d626fc54becf7ea799@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/wireless/nl80211.c