From: Florian Westphal <fw@strlen.de>
To: Ginger <ginger.jzllee@gmail.com>
Cc: steffen.klassert@secunet.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [bug report] Potential order bug in 'net/xfrm/xfrm_state.c', primarily in 'xfrm_state_walk_done()'
Date: Fri, 24 Apr 2026 21:31:00 +0200 [thread overview]
Message-ID: <aevE9IXgvj_Gx0gD@strlen.de> (raw)
In-Reply-To: <CAGp+u1autEHVxgs1pdqxz0kwExuKE3+XmQOtTC5bv-R7WU8nBw@mail.gmail.com>
Ginger <ginger.jzllee@gmail.com> wrote:
> Potential concurrent triggering executions:
> T0:
> xfrm_state_walk_done
> --> kfree(walk->filter); [t0]
> --> list_del(&walk->all); [t3]
list_del() uses same spinlock as iterator.
> T1:
> xfrm_state_walk
2652 int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk,
2653 int (*func)(struct xfrm_state *, int, void*),
2654 void *data)
2655 {
[..]
2663 spin_lock_bh(&net->xfrm.xfrm_state_lock);
2668 list_for_each_entry_from(x, &net->xfrm.state_all, all) {
2669 if (x->state == XFRM_STATE_DEAD)
2670 continue;
... and walker has STATE_DEAD, no? So I don't see how UaF is possible.
Even if parallel invocation (pfkey+netlink?) is possible, then we have:
T0: walk_done() -> free filter -> blocks on spinlock for list_del
T1: list_for_each ... -> walker is valid memory, checks x->state -> SKIP
to next entry
(or list_del already finished, but then _walk() is blocked on
spinlock).
prev parent reply other threads:[~2026-04-24 19:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-24 15:38 [bug report] Potential order bug in 'net/xfrm/xfrm_state.c', primarily in 'xfrm_state_walk_done()' Ginger
2026-04-24 19:31 ` Florian Westphal [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=aevE9IXgvj_Gx0gD@strlen.de \
--to=fw@strlen.de \
--cc=ginger.jzllee@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.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