From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756546AbbLANNW (ORCPT ); Tue, 1 Dec 2015 08:13:22 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37471 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755351AbbLANNQ (ORCPT ); Tue, 1 Dec 2015 08:13:16 -0500 Message-Id: <1448975595.3345555.454641969.3E702309@webmail.messagingengine.com> X-Sasl-Enc: vN/eMU4bs0KEUqZXU+y2OMofJgU2lfUJ8Ap/XfihL2hG 1448975595 From: Hannes Frederic Sowa To: Eric Dumazet Cc: Dmitry Vyukov , Vlad Yasevich , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , Eric Dumazet , William Dauchy , Rainer Weikusat , syzkaller , Kostya Serebryany , Alexander Potapenko , Sasha Levin MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-b94e6169 Subject: Re: [PATCH net] ipv6: add complete rcu protection around np->opt Date: Tue, 01 Dec 2015 14:13:15 +0100 In-Reply-To: <1448975100.25582.9.camel@edumazet-glaptop2.roam.corp.google.com> References: <1448730683.24696.94.camel@edumazet-glaptop2.roam.corp.google.com> <1448731434.24696.97.camel@edumazet-glaptop2.roam.corp.google.com> <1448854677.24696.117.camel@edumazet-glaptop2.roam.corp.google.com> <1448968286.3318880.454548345.76FA2174@webmail.messagingengine.com> <1448975100.25582.9.camel@edumazet-glaptop2.roam.corp.google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2015, at 14:05, Eric Dumazet wrote: > On Tue, 2015-12-01 at 12:11 +0100, Hannes Frederic Sowa wrote: > > 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 > > Yes, I mentioned this earlier, and will be addressed in net-next tree > later. > > (Same for np->pktoptions) > > The xchg() here does not bring additional protection as we are the last > user of np. > > Thanks. Ah, sorry, maybe I missed it. Just reviewed the patches after a longer weekend here. The rest looked fine to me: Acked-by: Hannes Frederic Sowa Thanks!