From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baozeng Ding Subject: Re: net/ipv6: potential deadlock in do_ipv6_setsockopt Date: Mon, 17 Oct 2016 17:54:57 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: Linux Kernel Network Developers To: Cong Wang Return-path: Received: from mail-pf0-f176.google.com ([209.85.192.176]:33605 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932687AbcJQJzH (ORCPT ); Mon, 17 Oct 2016 05:55:07 -0400 Received: by mail-pf0-f176.google.com with SMTP id 128so78135614pfz.0 for ; Mon, 17 Oct 2016 02:55:07 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Applied the patch to my test tree. I will tell you the result a few days later. Thank you. On 2016/10/17 2:50, Cong Wang wrote: > On Sun, Oct 16, 2016 at 6:34 AM, Baozeng Ding wrote: >> Possible unsafe locking scenario: >> >> CPU0 CPU1 >> ---- ---- >> lock([ 165.136033] sk_lock-AF_INET6 >> ); >> lock([ 165.136033] rtnl_mutex >> ); >> lock([ 165.136033] sk_lock-AF_INET6 >> ); >> lock([ 165.136033] rtnl_mutex >> ); >> >> *** DEADLOCK *** > > This is caused by the conditional rtnl locking in do_ipv6_setsockopt(). > It looks like we miss the case of IPV6_ADDRFORM. > > Please try the attached patch. >