Search Linux Wireless

Re: [PATCH v3 2/3] nl80211: Limit certain commands to interface owner

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/1/2019 5:33 PM, Denis Kenzior wrote:
If the wdev object has been created (via NEW_INTERFACE) with
SOCKET_OWNER attribute set, then limit certain commands only to the
process that created that wdev.

This can be used to make sure no other process on the system interferes
by sending unwanted scans, action frames or any other funny business.

This patch introduces a new internal flag, and checks that flag in the
pre_doit hook.

Signed-off-by: Denis Kenzior <denkenz@xxxxxxxxx>
---
  net/wireless/nl80211.c | 80 ++++++++++++++++++++++++++++++++----------
  1 file changed, 61 insertions(+), 19 deletions(-)

Changes in v3:
   - Fix minor locking mistake reported by kernel test robot

Changes in v2:
   - None

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ff760ba83449..ebf5eab1f9b2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c

[snip]

- return 0;
+	ret = 0;

I suggest to keep the return 0 here for success path and only do the below for failure case (and obviously dropping '&& ret < 0'). Maybe rename label 'done' to 'fail' as well.

+done:
+	if (rtnl && ret < 0)
+		rtnl_unlock();
+
+	return ret;
  }

Regards,
Arend



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux