Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp180849rdb; Thu, 30 Nov 2023 01:39:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGllCP8Wwj+jGLajYbpDrC0wNqjzoGSBrc5vbi00tBbFj+fDadzUxB4GxYICwKwTm586G4Y X-Received: by 2002:a17:90b:4d8b:b0:283:551b:bd95 with SMTP id oj11-20020a17090b4d8b00b00283551bbd95mr20728410pjb.13.1701337169378; Thu, 30 Nov 2023 01:39:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701337169; cv=none; d=google.com; s=arc-20160816; b=aTy0xKA9roBpBggv+HR3ZQOfWnxYgeH1pAAlSBNpaHFnzfaI53smVevZ6vO8l6i5Ay D4qkSOqcCkM1jVgrF9kzbB7/BpGYl4OG6b9ikvra97/eKdydA8ztctokNdzufTH19znV 5grO+pkmp8VUnFmBYHwYpv/jQNXkL3jMDTYxYvmJ8kEy8hNWL5K3L0/7Hs+/8vXTfltm 0txdrnaCHr8f6jwMZvAw2oQ36Uj4Pbbx61RqOmupxYho1ZXzDvM7yREVInslaZ2nXcws NxHZ4GWsQvcHr6xqg7BgKeVIOjegElkdgJnmK9VKw6j5wKw07+H/KfTf6GCxA/Ci+krn 6yvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+w0Xsdxg1xmtFzBpIVytZrwRsCdJaB2rhHg1ObCl0ac=; fh=vnDd9eMqgqXcWgLgXNq/w1qrHXG+VyZyybwvYFXKOvM=; b=nn7b7iuAyTV9+8A1X+o/mI0bmu1uEdVLDz1ePEnYGE3VYD9025tJPt+KuFaF167Hnq 9r+Lk3sj//jh8q+ZI8/6Ku0X2uyxmANkBV/oOKGy+SMgkJ5dQhj/HWrvR0iORGxUE5wC YixEHBRqsxn4qxoIXQDEiQrkSx2jWYoNLXEFvgWblOj/kxK/6yps27N1/ZMMlt2kgnjB Qp+WUtyUYUaYaEAeLT2MAnvfY/Yefc2OwpL4SWnQ4VL8abkfdLE+VM3f/jhkh4a2Hihg M1aIiW06EelhcQrNY2+aCTt8jT2FJec1qMyDqeJIfFhesAhYywsqI+014fAvEXCvSkJL KE/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EboWee2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id y12-20020a17090a86cc00b00283a54ed475si3245405pjv.110.2023.11.30.01.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 01:39:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=EboWee2Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 898E280952DE; Thu, 30 Nov 2023 01:39:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235021AbjK3JjE (ORCPT + 99 others); Thu, 30 Nov 2023 04:39:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjK3JjE (ORCPT ); Thu, 30 Nov 2023 04:39:04 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B845D4A for ; Thu, 30 Nov 2023 01:39:10 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-54bfa9b4142so8480a12.0 for ; Thu, 30 Nov 2023 01:39:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701337149; x=1701941949; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+w0Xsdxg1xmtFzBpIVytZrwRsCdJaB2rhHg1ObCl0ac=; b=EboWee2QIgu+TNRwGRV1uzm7x8ddpkdlWN3dnuIxKzJynRdVoMtJdpUKZrqBGcXGoB ioSfR8vs5rG2yyVyTVjdzkQFLxyd/bx8Hm9IxBgqMf6cfsfJH2u88lDL8lt7WHqPqlyl z6fWuDTTrWDwl9AFimk6oHaiuSj3m7uQcx5u6bm2KDcnhMBnwzwCyBe6XnTsNGvfaiu3 wrTwyBbsDBqsglVlQDp7stGGcaSkP4on3UqZOnfsydoHs4oz0eyjmvbNZuoP+awyFpyo 5GSCPLPyyohrjmB9dG3WRzKRqbZkaVuYdq7R7IJq3VywG048YF/i0AC37i3K289sp1As MtUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701337149; x=1701941949; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+w0Xsdxg1xmtFzBpIVytZrwRsCdJaB2rhHg1ObCl0ac=; b=AE0bTPC2SIZW+HEbwkgflBQ06Dtek8P11fTvBeBYOsD96pbNiGSbGNIyyNzPGqPzXj AMWFwYcFeyYQbBlFqKerHlo9BcsPO4wKqLoKf26gkZJ1y986NWlzjXPzg9lgJnB5jkil Hu2z/uw0HIZZ/mTxahV15Ius0VhfjMBBumiwoTzfjOIeb/5ypobYm8jYnuP/ovXXvsgr U83sd7KawqJZwIzey8DlrQ+r9RcMCsfPHTfWqIDaCsGYdSyBOyHhkW0fZAt6ydY+G1kG Sfmjo++RBI5jLR+P0q7oL4qlnBCmIOI2ThJe8/SRj4kQ+M0PNSnT5uKWKT6KEiloxfhg FGnQ== X-Gm-Message-State: AOJu0Yx1qASrfy/Z8pQM9abys8IvC0/xDJs/MFsgWRxyhvtyVrL6WXbs 0K+Z0eZONGcnOEH0KFKUK87hsYD0QxEXL8M26YcuXQ== X-Received: by 2002:a05:6402:1cae:b0:54b:81ba:93b2 with SMTP id cz14-20020a0564021cae00b0054b81ba93b2mr122702edb.2.1701337148606; Thu, 30 Nov 2023 01:39:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Eric Dumazet Date: Thu, 30 Nov 2023 10:38:57 +0100 Message-ID: Subject: Re: [syzbot] [net?] WARNING in cleanup_net (3) To: xingwei lee Cc: syzbot+9ada62e1dc03fdc41982@syzkaller.appspotmail.com, davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 30 Nov 2023 01:39:26 -0800 (PST) On Thu, Nov 30, 2023 at 9:46=E2=80=AFAM Eric Dumazet = wrote: > > On Thu, Nov 30, 2023 at 9:42=E2=80=AFAM xingwei lee wrote: > > > > Hello > > I reproduced this bug with repro.txt and repro.c > > > > > > > Is your syzbot instance ready to accept patches for testing ? > > Otherwise, a repro which happens to work 'by luck' might not work for me= . > > The bug here is a race condition with rds subsystem being dismantled > at netns dismantle, the 'repro' could be anything really. Can you test the following patch ? Thanks. diff --git a/net/core/sock.c b/net/core/sock.c index fef349dd72fa735b5915fc03e29cbb155b2aff2c..36d2871ac24f383e4e5d1af1168= 000f076011aae 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -2197,8 +2197,6 @@ static void __sk_destruct(struct rcu_head *head) if (likely(sk->sk_net_refcnt)) put_net_track(sock_net(sk), &sk->ns_tracker); - else - __netns_tracker_free(sock_net(sk), &sk->ns_tracker, false); sk_prot_free(sk->sk_prot_creator, sk); } @@ -2212,6 +2210,9 @@ void sk_destruct(struct sock *sk) use_call_rcu =3D true; } + if (unlikely(!sk->sk_net_refcnt)) + __netns_tracker_free(sock_net(sk), &sk->ns_tracker, false); + if (use_call_rcu) call_rcu(&sk->sk_rcu, __sk_destruct); else