]> git.baikalelectronics.ru Git - kernel.git/commit
nl80211: fix NLA_POLICY_NESTED() arguments
authorJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jan 2019 08:26:32 +0000 (09:26 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jan 2019 08:26:32 +0000 (09:26 +0100)
commitc47a82c3505e5cc9558bd9752ceacd2acc7aaba0
tree99a328c935c103028123f5b36d00dce999f19a05
parent66c89ce65dc34c02ee8402cc644280db9bb5aee4
nl80211: fix NLA_POLICY_NESTED() arguments

syzbot reported an out-of-bounds read when passing certain
malformed messages into nl80211. The specific place where
this happened isn't interesting, the problem is that nested
policy parsing was referring to the wrong maximum attribute
and thus the policy wasn't long enough.

Fix this by referring to the correct attribute. Since this
is really not necessary, I'll come up with a separate patch
to just pass the policy instead of both, in the common case
we can infer the maxattr from the size of the policy array.

Reported-by: syzbot+4157b036c5f4713b1f2f@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Fixes: f5b4872af518 ("cfg80211: add peer measurement with FTM initiator API")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c