linux/include
KaFai Wan 54377fcab5 bpf: Reject TCP_NODELAY in bpf-tcp-cc
A BPF TCP congestion control program can call bpf_setsockopt() from
its callbacks. In current kernels, if it calls
bpf_setsockopt(TCP_NODELAY) from cwnd_event_tx_start(), the call can
re-enter the TCP transmit path before the outer tcp_transmit_skb()
has completed and advanced the send head.

This can re-trigger CA_EVENT_TX_START and lead to unbounded recursion:

  tcp_transmit_skb()
    -> tcp_event_data_sent()
      -> tcp_ca_event(sk, CA_EVENT_TX_START)
        -> cwnd_event_tx_start()
          -> bpf_setsockopt(TCP_NODELAY)
            -> tcp_push_pending_frames()
              -> tcp_write_xmit()
                -> tcp_transmit_skb()

This leads to unbounded recursion and can overflow the kernel stack.

Reject TCP_NODELAY with -EOPNOTSUPP for bpf-tcp-cc by introducing
a dedicated setsockopt proto for BPF_PROG_TYPE_STRUCT_OPS TCP
congestion control programs. To keep it simple, all tcp-cc ops is
rejected for TCP_NODELAY.

Fixes: 7e41df5dbb ("bpf: Add a few optnames to bpf_setsockopt")
Suggested-by: Martin KaFai Lau <martin.lau@linux.dev>
Signed-off-by: KaFai Wan <kafai.wan@linux.dev>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20260421155804.135786-3-kafai.wan@linux.dev
History 2026-04-22 12:58:57 -07:00
..
acpi Power management updates for 7.1-rc1 2026-04-13 19:47:52 -07:00
asm-generic mm.git review status for linus..mm-nonmm-stable 2026-04-16 20:11:56 -07:00
clocksource clocksource/drivers/arm_arch_timer_mmio: Switch over to standalone driver 2025-09-23 12:31:50 +02:00
crypto This update includes the following changes: 2026-04-15 15:22:26 -07:00
cxl cxl: export internal structs for external Type2 drivers 2026-03-16 16:24:29 -07:00
drm ttm/pool: port to list_lru. (v2) 2026-04-08 06:52:47 +10:00
dt-bindings Support for Mobileye EyeQ6Lplus 2026-04-17 08:53:23 -07:00
hyperv mshv: Fix infinite fault loop on permission-denied GPA intercepts 2026-04-04 05:25:53 +00:00
keys keys/trusted_keys: establish PKWM as a trusted source 2026-01-30 09:27:26 +05:30
kunit kunit: irq: Ensure timer doesn't fire too frequently 2026-02-24 14:44:21 -08:00
kvm KVM: arm64: Kill arch_timer_context::direct field 2026-04-01 15:42:26 +01:00
linux bpf: Reject TCP_NODELAY in bpf-tcp-cc 2026-04-22 12:58:57 -07:00
math-emu powerpc/math-emu: Remove -w build flag and fix warnings 2022-09-05 17:28:25 +10:00
media media: subdev: Split v4l2_subdev_get_frame_desc_passthrough() into locked and unlocked 2026-03-24 11:58:02 +01:00
memory memory: renesas-rpc-if: Add RZ/G3E xSPI support 2025-05-01 12:22:25 +02:00
misc cxl: Remove driver 2025-03-16 22:04:27 +11:00
net mm.git review status for linus..mm-stable 2026-04-15 12:59:16 -07:00
pcmcia pcmcia: remove PCCARD_IODYN 2025-08-16 15:37:47 +02:00
ras PCI/AER: Report CXL or PCIe bus type in AER trace logging 2026-01-22 15:07:04 -07:00
rdma RDMA/core: Check id_priv->restricted_node_type in cma_listen_on_dev() 2026-02-25 07:50:10 -05:00
rv rv: Add support for per-object monitors in DA/HA 2026-03-31 16:47:17 +02:00
scsi SCSI misc on 20260212 2026-02-12 15:43:02 -08:00
soc firmware: tegra: Changes for v7.1-rc1 2026-04-02 23:13:02 +02:00
sound ASoC: Updates for v7.1 2026-04-13 18:09:48 +02:00
target scsi: target: core: Add emulation for REPORT IDENTIFYING INFORMATION 2025-12-16 21:07:22 -05:00
trace dma-mapping updates for Linux 7.0: 2026-04-17 11:12:42 -07:00
uapi Major changes: 2026-04-17 16:35:49 -07:00
ufs scsi: ufs: host: mediatek: Require CONFIG_PM 2026-02-03 22:28:44 -05:00
vdso vdso/datapage: Trim down unnecessary includes 2026-03-11 15:22:39 +01:00
video Merge drm/drm-next into drm-intel-next 2026-02-25 13:23:04 +02:00
xen xen/grant-table: guard gnttab_suspend/resume with CONFIG_HIBERNATE_CALLBACKS 2026-04-10 11:07:21 +02:00
Kbuild drm: ensure drm headers are self-contained and pass kernel-doc 2025-02-12 10:44:43 +02:00