]> git.itanic.dy.fi Git - linux-stable/commit
cfg80211: size various nl80211 messages correctly
authorJohannes Berg <johannes.berg@intel.com>
Mon, 9 Jan 2017 10:10:42 +0000 (11:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:24:14 +0000 (06:24 +0200)
commit9406040f3c2df634cd1bdfacbdc9771ea2ad163e
tree5e958820a066a5c147d0f29cfdcf8d07568969a3
parent270fdb1911521e482c0254d75fd6b13bea4607d8
cfg80211: size various nl80211 messages correctly

[ Upstream commit 4ef8c1c93f848e360754f10eb2e7134c872b6597 ]

Ilan reported that sometimes nl80211 messages weren't working if
the frames being transported got very large, which was really a
problem for userspace-to-kernel messages, but prompted me to look
at the code.

Upon review, I found various places where variable-length data is
transported in an nl80211 message but the message isn't allocated
taking that into account. This shouldn't cause any problems since
the frames aren't really that long, apart in one place where two
(possibly very long frames) might not fit.

Fix all the places (that I found) that get variable length data
from the driver and put it into a message to take the length of
the variable data into account. The 100 there is just a safe
constant for the remaining message overhead (it's usually around
50 for most messages.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/wireless/nl80211.c