From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752993AbaIBKHd (ORCPT ); Tue, 2 Sep 2014 06:07:33 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:37218 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752627AbaIBKH2 (ORCPT ); Tue, 2 Sep 2014 06:07:28 -0400 X-Sasl-enc: Dukq+AHMihRTRfczZn7OWKcPbZyO/6xBi4hEnwJZTA3R 1409652447 Message-ID: <1409652445.22584.16.camel@localhost> Subject: Re: [PATCH net v2] ipv6: fix rtnl locking in setsockopt for anycast and multicast From: Hannes Frederic Sowa To: Sabrina Dubroca Cc: Cong Wang , Tommi Rantala , "David S. Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev , LKML , trinity@vger.kernel.org, Dave Jones Date: Tue, 02 Sep 2014 12:07:25 +0200 In-Reply-To: <20140902082929.GA8483@kria> References: <20140829195339.GA9780@kria> <1409363489.2980.17.camel@localhost> <20140830105821.GB18155@kria> <1409599348.21965.6.camel@localhost> <20140901210520.GB25543@kria> <1409610378.21965.52.camel@localhost> <20140902082929.GA8483@kria> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-3.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Di, 2014-09-02 at 10:29 +0200, Sabrina Dubroca wrote: > Calling setsockopt with IPV6_JOIN_ANYCAST or IPV6_LEAVE_ANYCAST > triggers the assertion in addrconf_join_solict()/addrconf_leave_solict() > > ipv6_sock_ac_join(), ipv6_sock_ac_drop(), ipv6_sock_ac_close() need to > take RTNL before calling ipv6_dev_ac_inc/dec. Same thing with > ipv6_sock_mc_join(), ipv6_sock_mc_drop(), ipv6_sock_mc_close() before > calling ipv6_dev_mc_inc/dec. > > This patch moves ASSERT_RTNL() up a level in the call stack. > > Signed-off-by: Cong Wang > Signed-off-by: Sabrina Dubroca > Reported-by: Tommi Rantala > --- > As was said earlier, this should go in stable. > > v2: > - based on net > - keep dev_get_by_flags_rcu and RCU in ipv6_sock_ac_* > - remove two ASSERT_RTNL() that are not necessary > > Thank you for your help, Hannes! Thanks for fixing! ;) Acked-by: Hannes Frederic Sowa