From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756399AbbLALL3 (ORCPT ); Tue, 1 Dec 2015 06:11:29 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47671 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756200AbbLALL1 (ORCPT ); Tue, 1 Dec 2015 06:11:27 -0500 Message-Id: <1448968286.3318880.454548345.76FA2174@webmail.messagingengine.com> X-Sasl-Enc: 16bIVE6TprUAEYdKaHzJcE4Pg2MjfDMemTe/8xLFCPa6 1448968286 From: Hannes Frederic Sowa To: Eric Dumazet , Dmitry Vyukov Cc: 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 In-Reply-To: <1448854677.24696.117.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> Subject: Re: [PATCH net] ipv6: add complete rcu protection around np->opt Date: Tue, 01 Dec 2015 12:11:26 +0100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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