From: Hillf Danton <hdanton@sina.com>
To: Eric Dumazet <edumazet@google.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
syzbot+179fc225724092b8b2b2@syzkaller.appspotmail.com,
Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH net] dst: fix races in rt6_uncached_list_del() and rt_del_uncached_list()
Date: Tue, 24 Feb 2026 19:41:12 +0800 [thread overview]
Message-ID: <20260224114113.344-1-hdanton@sina.com> (raw)
In-Reply-To: <20260112103825.3810713-1-edumazet@google.com> (raw)
On Mon, 12 Jan 2026 10:38:25 +0000 Eric Dumazet wrote:
> syzbot was able to crash the kernel in rt6_uncached_list_flush_dev()
> in an interesting way [1]
>
> Crash happens in list_del_init()/INIT_LIST_HEAD() while writing
> list->prev, while the prior write on list->next went well.
>
> static inline void INIT_LIST_HEAD(struct list_head *list)
> {
> WRITE_ONCE(list->next, list); // This went well
> WRITE_ONCE(list->prev, list); // Crash, @list has been freed.
> }
>
> Issue here is that rt6_uncached_list_del() did not attempt to lock
> ul->lock, as list_empty(&rt->dst.rt_uncached) returned
> true because the WRITE_ONCE(list->next, list) happened on the other CPU.
>
> We might use list_del_init_careful() and list_empty_careful(),
> or make sure rt6_uncached_list_del() always grabs the spinlock
> whenever rt->dst.rt_uncached_list has been set.
>
> A similar fix is neeed for IPv4.
>
FYI list corruption in dst_destroy() [1] happened after this fix.
[1] Subject: Re: [syzbot] [kernel?] INFO: task hung in restrict_one_thread_callback
https://lore.kernel.org/lkml/699d155f.050a0220.247d23.0377.GAE@google.com/
next prev parent reply other threads:[~2026-02-24 11:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 10:38 [PATCH net] dst: fix races in rt6_uncached_list_del() and rt_del_uncached_list() Eric Dumazet
2026-01-12 15:23 ` David Ahern
2026-01-14 3:10 ` patchwork-bot+netdevbpf
2026-02-24 11:41 ` Hillf Danton [this message]
2026-02-24 11:58 ` Eric Dumazet
2026-02-25 7:33 ` Christian A. Ehrhardt
2026-02-25 8:15 ` Eric Dumazet
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=20260224114113.344-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+179fc225724092b8b2b2@syzkaller.appspotmail.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