mirror-linux/net/xfrm
Zhengchuan Liang c16f74dc1d xfrm: input: hold netns during deferred transport reinjection
Transport-mode reinjection stores a struct net pointer in skb->cb and
uses it later from xfrm_trans_reinject(). That pointer must stay valid
until the deferred callback runs.

Take a netns reference when queueing deferred reinjection work and drop
it after the callback completes. Use maybe_get_net() so the queueing
path does not revive a namespace that is already being torn down.

This keeps the existing workqueue design and fixes the netns lifetime
handling in one place for all users of xfrm_trans_queue_net().

Fixes: 7b3801927e ("xfrm: introduce xfrm_trans_queue_net")
Cc: stable@kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Co-developed-by: Luxing Yin <tr0jan@lzu.edu.cn>
Signed-off-by: Luxing Yin <tr0jan@lzu.edu.cn>
Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Assisted-by: Codex:gpt-5.4
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2026-05-26 10:35:30 +02:00
..
Kconfig pfkey: Deprecate pfkey 2025-10-30 09:03:12 +01:00
Makefile xfrm: iptfs: add new iptfs xfrm mode impl 2024-12-05 10:01:35 +01:00
espintcp.c net: convert remaining ipv6_stub users to direct function calls 2026-03-29 11:21:23 -07:00
trace_iptfs.h xfrm: iptfs: add tracepoint functionality 2024-12-05 10:02:36 +01:00
xfrm_algo.c xfrm: Drop support for HMAC-RIPEMD-160 2026-04-07 10:47:58 +02:00
xfrm_compat.c xfrm: netlink: add config (netlink) options 2024-12-05 10:01:15 +01:00
xfrm_device.c xfrm: always flush state and policy upon NETDEV_UNREGISTER event 2026-02-09 10:28:05 +01:00
xfrm_hash.c
xfrm_hash.h xfrm: add state hashtable keyed by seq 2021-05-14 13:52:01 +02:00
xfrm_inout.h xfrm: move xfrm4_extract_header to common helper 2020-05-06 09:40:08 +02:00
xfrm_input.c xfrm: input: hold netns during deferred transport reinjection 2026-05-26 10:35:30 +02:00
xfrm_interface_bpf.c bpf: treewide: Annotate BPF kfuncs in BTF 2024-01-31 20:40:56 -08:00
xfrm_interface_core.c xfrm: interface: fix use-after-free after changing collect_md xfrm interface 2025-07-04 09:25:25 +02:00
xfrm_ipcomp.c xfrm: ipcomp: Free destination pages on acomp errors 2026-05-11 10:34:35 +02:00
xfrm_iptfs.c xfrm: iptfs: reset runtime state when cloning SAs 2026-05-26 10:35:28 +02:00
xfrm_nat_keepalive.c net: convert remaining ipv6_stub users to direct function calls 2026-03-29 11:21:23 -07:00
xfrm_output.c xfrm: Don't clobber inner headers when already set 2026-04-28 06:47:20 +02:00
xfrm_policy.c xfrm: move policy_bydst RCU sync from per-netns .exit to .pre_exit 2026-05-26 10:35:29 +02:00
xfrm_proc.c xfrm: snmp: do not use SNMP_MIB_SENTINEL anymore 2025-09-08 18:06:21 -07:00
xfrm_replay.c ipsec-2025-01-27 2025-01-27 15:15:12 -08:00
xfrm_state.c xfrm: Check for underflow in xfrm_state_mtu 2026-05-14 10:17:43 +02:00
xfrm_state_bpf.c bpf: xfrm: drop dead NULL check in bpf_xdp_get_xfrm_state() 2026-01-02 12:04:29 -08:00
xfrm_sysctl.c net: Remove ctl_table sentinel elements from several networking subsystems 2024-05-03 13:29:42 +01:00
xfrm_user.c xfrm: route MIGRATE notifications to caller's netns 2026-05-07 09:31:10 +02:00