]> git.baikalelectronics.ru Git - kernel.git/commit
nl80211: Don't verify owner_nlportid on NAN commands
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Mon, 26 Jun 2017 16:52:30 +0000 (19:52 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 30 Jun 2017 06:44:17 +0000 (09:44 +0300)
commite3d4ef0861292d4abc4886af061965906b18d3ae
tree44c5e2f4e4dcb862ede0d6974c3d6bc7e5c134bb
parent0a8a8d41601d93f749dcc32538c70cb9407206d6
nl80211: Don't verify owner_nlportid on NAN commands

If NAN interface is created with NL80211_ATTR_SOCKET_OWNER, the socket
that is used to create the interface is used for all NAN operations and
reporting NAN events.
However, it turns out that sending commands and receiving events on
the same socket is not possible in a completely race-free way:
If the socket buffer is overflowed by the events, the command response
will not be sent. In that case the caller will block forever on recv.
Using non-blocking socket for commands is more complicated and still
the command response or ack may not be received.
So, keep unicasting NAN events to the interface creator, but allow
using a different socket for commands.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
include/uapi/linux/nl80211.h
net/wireless/nl80211.c