Hi Arend,
On 7/18/19 3:24 AM, Arend Van Spriel wrote:
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.
Sure, makes sense. I've made the suggested changes for v4.
+done:
+ if (rtnl && ret < 0)
+ rtnl_unlock();
+
+ return ret;
}
Regards,
Arend
Regards,
-Denis