BPF fixes for 7.4-rc5
Hi Linus,
The following changes since commit b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f:
Linux 7.4-rc4 (2026-11-22 14:57:40 -0800)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git tags/bpf-fixes
for you to fetch changes up to 02d3452bdd80cf645694110128db2ed67da96490:
bpf: Set the run context for async callbacks (2026-11-27 06:12:26 +0000)
----------------------------------------------------------------
Small fixes for various bugs all over bpf. The main themes:
. fix verifier bugs that let unsafe progs load
. require CAP_PERFMON in places where CAP_BPF alone leaked kernel addresses . fix x86 JIT crash with FineIBT, split locks from arena atomics
and unreliable stack traces
. fix arm64 JIT crash in bpf_throw() with shadow call stack
. fix leaks of uninitialized memory in skb, XDP, sk_msg and sockaddr helpers . add missing NULL checks and speculation barriers
- Various fixes (Alexei Starovoitov):
- Require CAP_PERFMON where CAP_BPF was enough to see kernel addresses or to touch other tasks: tracing helpers in syscall progs, arena and task work kfuncs, streams, kernel variables, dumps of xlated insns, etc.
- Zero bpf_list_head in copies of map values
- Check that an extension prog fits the hook of its target
- Compare the attach type and the properties of a hook at tail calls, reserve cookie and ip in the trampoline for them
- Look at the type of a prog next to expected_attach_type
- Check the attach type when a cgroup link gets another prog
- Check that a prog and a struct_ops map are for the same struct
- Fix the checks of R0 and bpf_get_retval() in struct_ops progs
- Don't trust pointers in flexible arrays and the neighbour of tp_btf/neigh_create
- Check for NULL in helpers that take a kernel pointer
- Don't allow bpf_d_path() by an id of another BTF
- Emit nospec after calls and atomics that write to the stack, undo insn aux changes of a failed speculative path
- Treat NOT_INIT as a pointer in __is_pointer_value()
- Let the bpf_fastcall boundary cover the longest pattern
- Give the error of bpf_res_spin_lock() a 32-bit range
- Use get_unaligned() in bpf_map_direct_read()
- Set the run context for async callbacks, fix NULL dereference in XDP redirect from them
- Fix bpf_throw() with tracers, KASAN and arm64 shadow call stack, add the symbol of a prog before its id, etc.
- Fix bpf_kfree_skb(), bpf_lock and the free of a list head or rb root with irqs off
- Bound the time that dumps of the stack take
- Fix arena: refuse mmap() of a part of it, flush TLB when a page replaces the scratch page, enforce alignment of atomics on x86
- Don't use the paranoid ITS thunk in x86 JIT, fix the range of BPF code that has a frame pointer
- Refuse metadata maps of signed progs that can be mapped writable
- Fix reads past an enum in prints of BTF data
- Keep the names in front of a number in bpffs delegate options
- Don't expose uninitialized bytes in bpf_msg_push_data(), loads from the network header and cgroup sockaddr hooks
- Fix dynptr slices behind the end of an XDP packet
- Take a neighbour of the L3 master in bpf_redirect_neigh()
- Keep the MAC header in bpf_skb_change_tail()
- Keep the parser and sk_data_ready in sync in sockmap, hold the psock of the work in sk_psock_backlog()
- Fix struct_ops members 59-61 and optional struct_ops maps in libbpf
- Various fixes (Sechang Lim):
- Reject kernel threads in bpf_task_work_schedule()
- Clear the redirect target after the sockmap stream parser runs
- Check program type on the migration path of sock_reuseport (Shihuang Liu)
----------------------------------------------------------------
Alexei Starovoitov (57):
bpf: Let the bpf_fastcall boundary cover the longest pattern
bpf: net_sched: Defer bpf_kfree_skb() to irq_work with irqs off
bpf: Save irq flags on the stack when freeing a list head or rb root
bpf: Do not trust pointers in flexible arrays
bpf: Look at the type of a program next to expected_attach_type
bpf: Do not take bpf_get_retval() of struct bpf_tcp_ops for an errno
bpf: Do not allow bpf_d_path() by an id of another BTF
bpf: Check that an extension fits the hook of its target
bpf: Take the attach type of the target for tail calls of an extension
bpf: Compare what a hook tells next to its prototype at tail calls
bpf: Reserve cookie and ip in the trampoline for tail calls
bpf: Check that a program and a struct_ops map are for the same struct
bpf: Keep the names in front of a number in delegate options
bpf: Do not trust the neighbour of tp_btf/neigh_create
bpf: Check for NULL in helpers that take a kernel pointer
bpf: Leave nothing behind in the frame of bpf_throw()
bpf: Add the symbol of a prog before its id
bpf: Do not fill jited line info for a hidden subprog
bpf: Fix NULL dereference in XDP redirect from async callbacks
bpf: Check the attach type when a cgroup link gets another program
bpf: Refuse metadata maps of signed programs that can be mapped writable
bpf: Take bpf_lock with interrupts disabled
bpf: Bound the time that dumps of the stack take
bpf: Refuse mmap() of a part of an arena
bpf: Flush TLB when a page of arena replaces the scratch page
bpf: Fix reads past an enum in prints of BTF data
bpf: Give the error of bpf_res_spin_lock() a 32-bit range
bpf: Give syscall programs without CAP_PERFMON the base helpers only
bpf: Require CAP_PERFMON for kfuncs that leak pointers or touch tasks
bpf: Require CAP_PERFMON to read streams
bpf: Limit reads of variables of the kernel
bpf: Require CAP_PERFMON for dumps of xlated insns
bpf: Zero bpf_list_head in copies of map values
bpf: Require CAP_PERFMON to read pinned maps with special fields
bpf: Require CAP_PERFMON to pass values of insn_array as memory
bpf: Require CAP_PERFMON for the dump of all storages of sockets bpf, x86: Do not use the paranoid ITS thunk
bpf, x86: Enforce alignment of atomics in arenas
bpf, x86: Fix the range of BPF code that has a frame pointer bpf, arm64: Restore the shadow call stack pointer after an exception
bpf: Clear the data that bpf_msg_push_data() adds
bpf: Fail loads from a network header that was not set
bpf: Fix slices behind the end of an XDP packet
bpf: Clear family and port of a short address for cgroup sockaddr hooks
bpf: Take a neighbour of the L3 master in bpf_redirect_neigh()
bpf: Keep the MAC header in bpf_skb_change_tail()
bpf, sockmap: Keep the parser and sk_data_ready in sync bpf, sockmap: Hold the psock of the work in sk_psock_backlog()
libbpf: Fix struct_ops members 59-61 and optional struct_ops maps
bpf: Check the type of R0 at the exit of a struct_ops program Merge branch 'bpf-fixes-for-hooks-tail-calls-cap_bpf-jits-and-sockmap'
bpf: Undo insn aux changes of a failed speculative path
bpf: Treat NOT_INIT as a pointer in __is_pointer_value()
bpf: Use get_unaligned() in bpf_map_direct_read()
bpf: Emit nospec after calls and atomics that write to the stack Merge branch 'bpf-fixes-for-speculation-barriers-and-constant-reads'
bpf: Set the run context for async callbacks
Sechang Lim (2):
bpf: Reject kernel threads in bpf_task_work_schedule() bpf, sockmap: Clear the redirect target after the stream parser runs
Shihuang Liu (1):
net: sock_reuseport: Check program type on the migration path
Documentation/bpf/kfuncs.rst | 3 +- Documentation/bpf/signing.rst | 3 +- arch/arm64/net/bpf_jit_comp.c | 7 ++ arch/x86/net/bpf_jit_comp.c | 53 ++++++++-- include/linux/bpf.h | 44 ++++++-- include/linux/btf.h | 1 + include/linux/filter.h | 15 ++- include/uapi/linux/bpf.h | 3 +- kernel/bpf/arena.c | 40 ++++--- kernel/bpf/bpf_struct_ops.c | 20 +++- kernel/bpf/btf.c | 52 +++++++-- kernel/bpf/cgroup.c | 33 +++++- kernel/bpf/core.c | 50 +++++++-- kernel/bpf/fixups.c | 18 +++- kernel/bpf/helpers.c | 86 ++++++++------- kernel/bpf/inode.c | 10 +- kernel/bpf/stackmap.c | 2 +- kernel/bpf/stream.c | 25 ++++- kernel/bpf/syscall.c | 42 ++++++-- kernel/bpf/verifier.c | 117 ++++++++++++++++----- kernel/sched/ext/internal.h | 5 +- kernel/trace/bpf_trace.c | 8 +- net/bpf/bpf_dummy_struct_ops.c | 2 +- net/core/bpf_sk_storage.c | 4 + net/core/filter.c | 46 +++++--- net/core/skmsg.c | 16 ++- net/core/sock_map.c | 3 +- net/core/sock_reuseport.c | 16 ++- net/ipv4/bpf_tcp_ops.c | 2 +- net/sched/bpf_qdisc.c | 27 +++++ tools/include/uapi/linux/bpf.h | 3 +- tools/lib/bpf/libbpf.c | 19 ++-- .../testing/selftests/bpf/test_kmods/bpf_testmod.c | 6 +- 33 files changed, 606 insertions(+), 175 deletions(-)
The pull request you sent on Fri, 27 Nov 2026 22:44:22 +0000:
The pull request you sent on Fri, 27 Nov 2026 22:44:22 +0000:
Quoted 1 line
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git tags/bpf-fixes
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/d3a5ea8a82fabeb2314700c2e001130faf99df1f
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html
This pull request was applied to bpf/bpf.git (master) by Linus Torvalds <[email protected]>:
Hello:
This pull request was applied to bpf/bpf.git (master) by Linus Torvalds <[email protected]>:
Quoted 9 lines · On Fri, 27 Nov 2026 22:44:22 +0000 you wrote:
Hi Linus,
The following changes since commit
b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f:Linux 7.4-rc4 (2026-11-22 14:57:40 -0800)
are available in the Git repository at:
[...]
Here is the summary with links:
- [GIT,PULL] BPF fixes for 7.4-rc5
https://git.kernel.org/bpf/bpf/c/d3a5ea8a82fa
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html