All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] Potential order bug in 'net/xfrm/xfrm_state.c', primarily in 'xfrm_state_walk_done()'
@ 2026-04-24 15:38 Ginger
  2026-04-24 19:31 ` Florian Westphal
  0 siblings, 1 reply; 2+ messages in thread
From: Ginger @ 2026-04-24 15:38 UTC (permalink / raw)
  To: steffen.klassert; +Cc: netdev, linux-kernel

Dear Linux kernel maintainers,

My research-based static analyzer found a potential orderbug within
the 'net/xfrm' subsystem, more specifically, in
'net/xfrm/xfrm_state.c'.

Kernel version: long-term kernel v6.18.9

Potential concurrent triggering executions:
T0:
xfrm_state_walk_done
    --> kfree(walk->filter); [t0]
    --> list_del(&walk->all); [t3]

T1:
xfrm_state_walk
   --> list_for_each_entry_from(x, &net->xfrm.state_all, all) [t1]
   --> __xfrm_state_filter_match(state, walk->filter) [t2]

In T0, 'walk->filter' is free before the parent 'walk' gets removed
from the global list. Thus, it is possible for T1 to still get the
same 'walk' by iterating through the list linked via 'walk->all' and
access the 'filter' field, which has already been freed.
The concurrent buggy order is t0 -> t1 -> t2 -> t3.

Thank you for your time and consideration.

Sincerely,
Ginger

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-24 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.