]> git.baikalelectronics.ru Git - kernel.git/commit
cfg80211: check vendor command doit pointer before use
authorJulian Squires <julian@cipht.net>
Mon, 6 Jul 2020 21:13:53 +0000 (17:13 -0400)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 30 Jul 2020 08:24:01 +0000 (10:24 +0200)
commitda68de306162607ab10bd17718a42f390b343cc9
tree7e71b33bfcd5c53830921859b0748e0da77ed67a
parent1683c970347489b96c1303c3a14cebd725334fa8
cfg80211: check vendor command doit pointer before use

In the case where a vendor command does not implement doit, and has no
flags set, doit would not be validated and a NULL pointer dereference
would occur, for example when invoking the vendor command via iw.

I encountered this while developing new vendor commands.  Perhaps in
practice it is advisable to always implement doit along with dumpit,
but it seems reasonable to me to always check doit anyway, not just
when NEED_WDEV.

Signed-off-by: Julian Squires <julian@cipht.net>
Link: https://lore.kernel.org/r/20200706211353.2366470-1-julian@cipht.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c