From: Paolo Abeni <pabeni@redhat.com>
To: Zheng Shuhao <viennaoffh@gmail.com>, netdev@vger.kernel.org
Cc: Jason@zx2c4.com, wireguard@lists.zx2c4.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org,
syzbot+434045ea68296f3f0219@syzkaller.appspotmail.com
Subject: Re: [PATCH net] wireguard: peerlookup: avoid redundant peer pointer store
Date: Wed, 2 Dec 2026 13:17:31 +0100 [thread overview]
Message-ID: <444510d0-308a-4d82-8725-01ff1dea2020@redhat.com> (raw)
In-Reply-To: <20261124150517.565-1-viennaoffh@gmail.com>
On 11/24/26 16:05, Zheng Shuhao wrote:
> syzbot reported a KCSAN data race between
> wg_index_hashtable_lookup() and wg_packet_decrypt_worker().
>
> wg_index_hashtable_lookup() obtains a reference to entry->peer, then
> writes the reference back to entry->peer. The peer pointer is set when
> the index entry is initialized; the lookup does not need to modify it.
> Packet workers read this field concurrently, so the redundant store
> triggers the KCSAN report.
>
> Keep the acquired reference in a local variable and return it through
> the peer output parameter instead.
>
> Testing:
> - Built x86_64 with CONFIG_KCSAN=y and CONFIG_KCSAN_EARLY_ENABLE=y.
> CONFIG_KCSAN_REPORT_VALUE_CHANGE_ONLY and
> CONFIG_KCSAN_ASSUME_PLAIN_WRITES_ATOMIC were unset.
> - Ran a 120-second local QEMU stress test with bidirectional UDP traffic
> over two WireGuard network namespaces. Four iperf3 ports with -P 8
> generated 32 streams per direction (64 total). The baseline reported
> 39 races involving wg_packet_decrypt_worker and 115 reports involving
> wg_index_hashtable_lookup overall. The patched kernel reported none
> involving wg_index_hashtable_lookup. Both runs completed successfully;
> unrelated KCSAN reports remained in the patched run.
> - The upstream WireGuard QEMU selftest suite was not rerun with this
> exact KCSAN configuration.
>
> Reported-by: syzbot+434045ea68296f3f0219@syzkaller.appspotmail.com
> Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
> Closes: https://syzkaller.appspot.com/bug?extid=434045ea68296f3f0219
> Signed-off-by: Zheng Shuhao <viennaoffh@gmail.com>
@Jason: I assume this will go via your tree first, please LMK if you
prefer we take it directly.
FTR, the data race looks harmless, this is net-next material,
/P
prev parent reply other threads:[~2026-12-02 12:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 15:05 [PATCH net] wireguard: peerlookup: avoid redundant peer pointer store Zheng Shuhao
2026-12-02 12:17 ` Paolo Abeni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=444510d0-308a-4d82-8725-01ff1dea2020@redhat.com \
--to=pabeni@redhat.com \
--cc=Jason@zx2c4.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+434045ea68296f3f0219@syzkaller.appspotmail.com \
--cc=viennaoffh@gmail.com \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox