netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>,
	netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	William Dauchy <wdauchy@gmail.com>,
	Rainer Weikusat <rweikusat@mobileactivedefense.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: Re: [PATCH net] ipv6: add complete rcu protection around np->opt
Date: Tue, 01 Dec 2015 12:11:26 +0100	[thread overview]
Message-ID: <1448968286.3318880.454548345.76FA2174@webmail.messagingengine.com> (raw)
In-Reply-To: <1448854677.24696.117.camel@edumazet-glaptop2.roam.corp.google.com>

Hi Eric,

On Mon, Nov 30, 2015, at 04:37, Eric Dumazet wrote:
> -                       opt = xchg(&np->opt, NULL);
> -                       if (opt)
> -                               sock_kfree_s(sk, opt, opt->tot_len);
> +                       opt = xchg((__force struct ipv6_txoptions
> **)&np->opt,
> +                                  NULL);
> +                       if (opt) {
> +                               atomic_sub(opt->tot_len,
> &sk->sk_omem_alloc);
> +                               txopt_put(opt);
> +                       }
>  			pktopt = xchg(&np->pktoptions, NULL);
>  			kfree_skb(pktopt);

Is here something special going on (because of the xchg). I don't see
why you cannot simply use a RCU_INIT_POINTER?

Thanks,
Hannes

  reply	other threads:[~2015-12-01 11:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-28 11:00 use-after-free in ip6_setup_cork Dmitry Vyukov
2015-11-28 17:11 ` Eric Dumazet
2015-11-28 17:23   ` Eric Dumazet
2015-11-30  3:29     ` Eric Dumazet
2015-11-30 16:35       ` [PATCH net] ipv6: kill sk_dst_lock Eric Dumazet
2015-11-30 18:13         ` Paolo Abeni
2015-11-30 18:27           ` Eric Dumazet
2015-12-01  1:44         ` YOSHIFUJI Hideaki
2015-12-01  2:01           ` Eric Dumazet
2015-12-03  4:42         ` David Miller
2015-12-03  5:53           ` [PATCH v2 " Eric Dumazet
2015-12-03 16:32             ` David Miller
2015-12-03 16:49               ` Eric Dumazet
2015-12-03 16:49                 ` Eric Dumazet
2015-12-03  5:57           ` [PATCH " Eric Dumazet
2015-11-30  3:37     ` [PATCH net] ipv6: add complete rcu protection around np->opt Eric Dumazet
2015-12-01 11:11       ` Hannes Frederic Sowa [this message]
2015-12-01 13:05         ` Eric Dumazet
2015-12-01 13:13           ` Hannes Frederic Sowa
2015-12-03  4:38       ` David Miller
2015-12-03  5:35         ` Eric Dumazet
2015-12-03  5:48           ` [PATCH net] ipv6: sctp: add " Eric Dumazet
2015-12-03 16:32             ` 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=1448968286.3318880.454548345.76FA2174@webmail.messagingengine.com \
    --to=hannes@stressinduktion.org \
    --cc=davem@davemloft.net \
    --cc=dvyukov@google.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=glider@google.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kcc@google.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rweikusat@mobileactivedefense.com \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=vyasevich@gmail.com \
    --cc=wdauchy@gmail.com \
    --cc=yoshfuji@linux-ipv6.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).