netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	netdev@vger.kernel.org
Cc: hannes@stressinduktion.org
Subject: Re: [PATCH net-next] ipv6: invert join/leave anycast  rtnl/socket locking order
Date: Fri, 20 Mar 2015 17:24:32 +0300	[thread overview]
Message-ID: <550C2DA0.6050809@cogentembedded.com> (raw)
In-Reply-To: <1426857632-17879-1-git-send-email-marcelo.leitner@gmail.com>

Hello.

On 3/20/2015 4:20 PM, Marcelo Ricardo Leitner wrote:

> Commit baf606d9c9b1 ("ipv4,ipv6: grab rtnl before locking the socket")
> missed to update two setsockopt options, IPV6_JOIN_ANYCAST and
> IPV6_LEAVE_ANYCAST, causing a lock inverstion regarding the updated ones.

> As ipv6_sock_ac_join and ipv6_sock_ac_leave are only called from
> do_ipv6_setsockopt, we are good to just move the rtnl lock upper.

> Fixes: baf606d9c9b1 ("ipv4,ipv6: grab rtnl before locking the socket")
> Reported-by: Ying Huang <ying.huang@intel.com>
> Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
>   net/ipv6/anycast.c       | 9 ++++-----
>   net/ipv6/ipv6_sockglue.c | 2 ++
>   2 files changed, 6 insertions(+), 5 deletions(-)

> diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
> index baf2742d1ec47ee1b9cf62d087afb8b7d7195921..a1db95e863ffdd1aa1cb5112da11ccdef9e945fd 100644
> --- a/net/ipv6/anycast.c
> +++ b/net/ipv6/anycast.c
[...]
> @@ -155,7 +156,6 @@ int ipv6_sock_ac_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
>   		prev_pac = pac;
>   	}
>   	if (!pac) {
> -		rtnl_unlock();
>   		return -ENOENT;
>   	}

    Get rid of {} please, as they're not needed anymore.

[...]

WBR, Sergei

  reply	other threads:[~2015-03-20 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 13:20 [PATCH net-next] ipv6: invert join/leave anycast rtnl/socket locking order Marcelo Ricardo Leitner
2015-03-20 14:24 ` Sergei Shtylyov [this message]
2015-03-20 14:37   ` [PATCH net-next v2] " Marcelo Ricardo Leitner
2015-03-20 17:33     ` David Miller

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=550C2DA0.6050809@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=hannes@stressinduktion.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@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).