linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v3 2/3] nl80211: Limit certain commands to interface owner
Date: Mon, 22 Jul 2019 06:32:44 -0500	[thread overview]
Message-ID: <b81ed4a0-0b41-fff2-2bab-7219db2c9e35@gmail.com> (raw)
In-Reply-To: <d75d6f90-1691-57fa-ddb2-ece84f5d262f@broadcom.com>

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@gmail.com>
>> ---
>>   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

  reply	other threads:[~2019-07-22 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-01 15:33 [PATCH v3 1/3] nl80211: Update uapi for CMD_FRAME_WAIT_CANCEL Denis Kenzior
2019-07-01 15:33 ` [PATCH v3 2/3] nl80211: Limit certain commands to interface owner Denis Kenzior
2019-07-18  8:24   ` Arend Van Spriel
2019-07-22 11:32     ` Denis Kenzior [this message]
2019-07-31  9:51   ` Johannes Berg
2019-07-31 10:30     ` Denis Kenzior
2019-07-01 15:33 ` [PATCH v3 3/3] nl80211: Include wiphy address setup in NEW_WIPHY Denis Kenzior
2019-07-09 15:27 ` [PATCH v3 1/3] nl80211: Update uapi for CMD_FRAME_WAIT_CANCEL Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b81ed4a0-0b41-fff2-2bab-7219db2c9e35@gmail.com \
    --to=denkenz@gmail.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).