]> git.hungrycats.org Git - linux/commit
mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length
authorJohannes Berg <johannes.berg@intel.com>
Mon, 27 Feb 2017 16:15:28 +0000 (17:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Oct 2017 15:09:04 +0000 (17:09 +0200)
commit3e8c1a04d33500957fe1409ddf5cf11b52b7f6ed
treed21ee34d33ee7b29c234036ce8e03efbc79f5afb
parent4a464dacc23fdbcdce25ee8210da0b349cd32585
mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length

[ Upstream commit ff4dd73dd2b4806419f8ff65cbce11d5019548d0 ]

Unfortunately, the nla policy was defined to have HWSIM_ATTR_RADIO_NAME
as an NLA_STRING, rather than NLA_NUL_STRING, so we can't use it as a
NUL-terminated string in the kernel.

Rather than break the API, kasprintf() the string to a new buffer to
guarantee NUL termination.

Reported-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mac80211_hwsim.c