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)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 27 Feb 2017 16:15:28 +0000 (17:15 +0100)
commitff4dd73dd2b4806419f8ff65cbce11d5019548d0
tree9b89283d30c9398a343851bca77f4f1d34465ac3
parent09e0a2fe102208cbaf39510b8b04dd524d7d2935
mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length

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>
drivers/net/wireless/mac80211_hwsim.c