History

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.

Andrei Otcheretianski committed 9 years ago

Commit 36a554c1 parent 123fef32 files · +4 −13Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+4−5
@@ -1909,11 +1909,10 @@ enum nl80211_commands { · 1908 unmodified lines
1909 * that configured the indoor setting, and the indoor operation would be1909 * that configured the indoor setting, and the indoor operation would be
1910 * cleared when the socket is closed.1910 * cleared when the socket is closed.
1911 * If set during NAN interface creation, the interface will be destroyed1911 * If set during NAN interface creation, the interface will be destroyed
1912 * if the socket is closed just like any other interface. Moreover, only1912 * if the socket is closed just like any other interface. Moreover, NAN
1913 * the netlink socket that created the interface will be allowed to add1913 * notifications will be sent in unicast to that socket. Without this
1914 * and remove functions. NAN notifications will be sent in unicast to that1914 * attribute, the notifications will be sent to the %NL80211_MCGRP_NAN
1915 * socket. Without this attribute, any socket can add functions and the1915 * multicast group.
1916 * notifications will be sent to the %NL80211_MCGRP_NAN multicast group.
1917 * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the1916 * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the
1918 * station will deauthenticate when the socket is closed.1917 * station will deauthenticate when the socket is closed.
1919 *1918 *