linux/net/mptcp
Eric Dumazet 18666c73af tcp: use GFP_ATOMIC in tcp_send_active_reset()
tcp_send_active_reset() can be called from contexts where gfp_any()
(in tcp_disconnect()) or sk->sk_allocation (in __tcp_close() and
mptcp_do_fastclose()) evaluates to GFP_KERNEL, which includes
__GFP_FS and __GFP_DIRECT_RECLAIM.

Allocating with GFP_KERNEL while holding the socket lock (sk_lock) creates
a lockdep dependency:
  sk_lock -> fs_reclaim

This causes false-positive lockdep circular locking warnings with storage
subsystems (such as nvme-tcp) that acquire socket locks in block I/O paths
and invoke tcp_disconnect() or close sockets upon teardown:
  set->srcu -> sk_lock -> fs_reclaim -> elevator_lock -> set->srcu

Active resets are small RST packet headers that should never
enter direct reclaim or block while holding socket locks.

Use sk_gfp_mask(sk, GFP_ATOMIC | __GFP_NOWARN) inside tcp_send_active_reset()
and remove its priority argument. This preserves __GFP_MEMALLOC access
for SOCK_MEMALLOC sockets, suppresses allocation failure warnings,
and aligns with other control packet allocations (e.g. tcp_send_fin(),
__tcp_send_ack(), tcp_xmit_probe_skb()).

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260827095936.551524-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-28 15:35:38 -07:00
..
bpf.c mptcp: bpf: Fix type confusion in bpf_mptcp_sock_from_subflow() 2026-05-08 11:38:10 -07:00
crypto_test.c
crypto.c mptcp: use HMAC-SHA256 library instead of open-coded HMAC 2025-09-03 15:08:20 -07:00
ctrl.c mptcp: introduce add_addr_v6_port_drop_ts sysctl knob 2026-06-11 15:33:37 -07:00
diag.c tcp: ulp: diag: more info without CAP_NET_ADMIN 2025-03-07 19:39:53 -08:00
fastopen.c mptcp: fastopen: only mark MPTFO subflows with SYN data 2026-08-06 08:46:23 -07:00
Kconfig mptcp: select CRYPTO_LIB_UTILS instead of CRYPTO 2025-12-08 23:44:16 -08:00
Makefile mptcp: pm: split in-kernel PM specific code 2025-03-10 13:35:50 -07:00
mib.c mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
mib.h mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
mptcp_diag.c mptcp: introduce mptcp-level backlog 2025-11-24 19:49:43 -08:00
mptcp_pm_gen.c tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
mptcp_pm_gen.h tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
options.c mptcp: explicitly drop over memory limits 2026-08-11 18:35:37 -07:00
pm_kernel.c mptcp: pm: uniform announced addresses helpers 2026-06-11 15:33:38 -07:00
pm_netlink.c mptcp: pm: ignore unknown endpoint flags 2025-12-08 23:54:02 -08:00
pm_userspace.c mptcp: pm: userspace: make remove_addr_entry static 2026-08-17 17:25:49 -07:00
pm.c mptcp: pm: add WARN_ON_ONCE guards on extra_subflows underflow 2026-08-17 17:25:49 -07:00
protocol.c tcp: use GFP_ATOMIC in tcp_send_active_reset() 2026-08-28 15:35:38 -07:00
protocol.h tcp: use GFP_ATOMIC in tcp_send_active_reset() 2026-08-28 15:35:38 -07:00
sched.c mptcp: sched: split validation part 2025-04-15 08:21:46 -07:00
sockopt.c mptcp: sockopt: set sockopt on all subflows 2026-06-03 19:04:26 -07:00
subflow.c mptcp: add per-event MIB counters for MPTCP_RST_EMPTCP resets 2026-08-17 17:25:49 -07:00
syncookies.c mptcp: fix uninitialized local_id in syncookie MP_JOIN reconstruction 2026-08-20 12:53:14 -07:00
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00
token.c mptcp: fix kdoc warnings 2026-02-06 20:35:06 -08:00