Linux wireless drivers development
 help / color / mirror / Atom feed
From: Arend Van Spriel <arend.vanspriel@broadcom.com>
To: Denis Kenzior <denkenz@gmail.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: Thu, 18 Jul 2019 10:24:24 +0200	[thread overview]
Message-ID: <d75d6f90-1691-57fa-ddb2-ece84f5d262f@broadcom.com> (raw)
In-Reply-To: <20190701153317.27170-2-denkenz@gmail.com>

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.

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

Regards,
Arend

  reply	other threads:[~2019-07-18  8:24 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 [this message]
2019-07-22 11:32     ` Denis Kenzior
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=d75d6f90-1691-57fa-ddb2-ece84f5d262f@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=denkenz@gmail.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