From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796321121; b=jxi49jhWEInxz3ZNl44a2ywpPoWCFJ6t9ZFgXS76YOzfr/AC1sULs9SSN6Y8CEAPIMk7 lbWZXRDvft9d0q1a5OPoD55nPpDrgHl6aekSlfDwir2YmCjyU7O/9+h6eswTs2CRbR2Be h0Eb50etRx84cF6d+9/Sstdj/jfvnA8OE1AOao/x/xcYz4ACptTcXBZQI/ZugUWS6+qLY zGBF2qYwIvF6dubGzhJz5lxTpgSCO3L7o8PZpUpdnpgSXd1vNFIW9wbPM8l2G6dWg4SrH Bnqri7GCS7YqfCuhK19phLHZneJL1r9XdQ8g2fzz6VG3NqBvbFm1F0p9gMYfKueb0Cg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796321121; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=c3UvURX5MeuJjDH84GfMDug/g7KmOW+9E0gpNuE1AuA=; b=AOWpvW8STWJQPRQeA/KkYl1uR7+qKo3MPSiAvuSrT8IgkVzXbZudIUtUa1gHhS8iZQ0l aZEovj9TjZBHla6gKh62c1Hmf/Q8k2dhIt6JrFHgn6U8k9D6XfiycFGuV4nUAME6imAxH 5P8Qes3Oaff5Q9m6RXPWOf5mrrJIQGBCPJbsHmVj/9HVoJlqXuL/id1R9KOlTKH6OCIYr AAismVI7NW9hauMZR2iyAgLwt0Q7N2bFMHp06yYKJmw5/7KWMa2cMq+RioLoyLz8rdCMr bp5Dy+WHdvIqC/aZy9Ku7E0CBBbW9/0avXLCyzvDpWrFeiOHvCtG7BcBEscP0Rtm0pQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KgoeJnoE; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07A2F606A322 for ; Thu, 3 Dec 2026 18:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KgoeJnoE Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4622D1F0089B; Thu, 3 Dec 2026 18:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796321120; bh=c3UvURX5MeuJjDH84GfMDug/g7KmOW+9E0gpNuE1AuA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=KgoeJnoEyHVM/ezKAi7dT39AVsukLfmGcO3he0kPA7p/rnAqGAXVqZlCuH7QMclif vZkZ4YMu+KAmVj5wXZO8NKncJ+Tuc1op0AAEmIdbkVirqUKp1C/3sIDT4tM/QaxjzS iVkNTvDO1r+6598fbghb0KyyepGNl/BMTrlQddwP618OBDpAp7W5pqhVnJktmmO6OD M0idqAihARle4zqTO7TcDqhGA19NAynFXqNn2CnmCutZF2tNwsMhBUnMe4uANJx5UQ hYgL5hwAm//OrTzLqZwQ6CcDERY5UIx/a2e/WlUobHejPhz9OdLoYINpnyGq9HBouU dae8cEC4VphVA== Subject: Re: [PATCH net-next] net: use RCU_INIT_POINTER() to clear sk->sk_wq in sock_orphan() From: netdev-bot+sashiko@kernel.org To: zhangjiayi1014@gmail.com Cc: edumazet@kernel.org, kuniyu@google.com, pabeni@redhat.com, willemb@google.com, davem@davemloft.net, kuba@kernel.org, horms@kernel.org, netdev@vger.kernel.org, syzbot+c2e012bd497ee37068b0@syzkaller.appspotmail.com, syzkaller-bugs@googlegroups.com Date: Thu, 03 Dec 2026 18:05:19 +0000 Message-ID: <179632111980.3146.9699155298810510139@kernel.org> In-Reply-To: <20261202180315.4144359-1-zhangjiayi1014@gmail.com> References: <20261202180315.4144359-1-zhangjiayi1014@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The patch carries `Closes:` for the syzbot bug titled "data- race in unix_release_sock / unix_write_space", but one of the access… -- net: use RCU_INIT_POINTER() to clear sk->sk_wq in sock_orphan() This patch changes the plain store that clears sk->sk_wq in sock_orphan() to RCU_INIT_POINTER(), so the store is done with WRITE_ONCE(). The goal is to silence a KCSAN data-race report between unix_release_sock() and unix_write_space() that syzbot found. Closes: https://syzkaller.appspot.com/bug?extid=c2e012bd497ee37068b0 > diff --git a/include/net/sock.h b/include/net/sock.h > index 5a203809218aa..9d22ccd91838d 100644 > --- a/include/net/sock.h > +++ b/include/net/sock.h > @@ -2168,7 +2168,7 @@ static inline void sock_orphan(struct sock *sk) > write_lock_bh(&sk->sk_callback_lock); > sock_set_flag(sk, SOCK_DEAD); [Severity: Medium] Will the syzbot bug in the Closes: tag still be reported after this patch? sock_set_flag() is a plain non-atomic read-modify-write of the whole sk_flags word: include/net/sock.h:sock_set_flag() { __set_bit(flag, &sk->sk_flags); } On the peer side, the skb free path reads the same word without holding sk_callback_lock: unix_release_sock()->kfree_skb_reason()->unix_wfree()->sock_wfree() ->unix_write_space()->sk_wake_async_rcu() include/net/sock.h:sk_wake_async_rcu() { if (unlikely(sock_flag(sk, SOCK_FASYNC))) sock_wake_async(rcu_dereference(sk->sk_wq), how, band); } unix_write_space() only holds rcu_read_lock(), so no lock is shared with sock_orphan(). KCSAN can still report this pair under the same title, "data-race in unix_release_sock / unix_write_space". The notes below the changelog say this pair shows up in 3 of the 35 syzbot crashes and in 3 of 5 local runs with the patch applied. Once this is merged, syzbot would close the bug and then report it again from the same reproducer. Should the sk_flags access be handled too? One option is an atomic set_bit() for SOCK_DEAD in sock_orphan(). Another is data_race() on the reader side. If that is out of scope, could the Closes: tag be changed so it does not claim the whole syzbot report is fixed? > sk_set_socket(sk, NULL); > - sk->sk_wq = NULL; > + RCU_INIT_POINTER(sk->sk_wq, NULL); > write_unlock_bh(&sk->sk_callback_lock); > } -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202180315.4144359-1-zhangjiayi1014%40gmail.com