BPF fixes for 7.4-rc4
Hi Linus,
The following changes since commit 05441d697f7f9a927264f4058cbbc6a03dfcac9d:
Merge tag 'cocci-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux (2026-11-03 08:36:32 -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 d5ba86298b45e1a81c578c499e9a222a3b734d5d:
Merge branch 'bpf-limit-writable-registers-in-uprobe-context' (2026-11-20 02:31:05 +0000)
There is one trivial conflict with your current tree, in kernel/bpf/bpf_lsm.c, between commit
ea8c4b37b880 ("bpf: don't mark namespace_init and namespace_free arguments as trusted")
from vfs tree and commit
ab86b62012b9 ("bpf, lsm: Mark backing_file_alloc/free LSM hooks as untrusted")
from bpf. Both add two lines at the same place in untrusted_lsm_hooks.
Keep all four.
That's what Mark reported:
https://lore.kernel.org/linux-next/[email protected]/
----------------------------------------------------------------
Mostly sockmap fixes that the previous PR promised, plus uprobe ctx rewrite via bpf and cgroup-bpf fixes.
- Reject writable map iterators on read-only maps
(Adethya Srinivasan)
- Various sockmap fixes (Alexei Starovoitov):
- Clear the redirect target before the sk_msg prog runs
- Check that the redirected message is the cork
- Leave sk_stream_wait_memory() once the socket is dead
- Keep the rest of the cork after a redirect
- Don't let an SK_PASS verdict cover the next message
- Subtract all dropped bytes from the return value of sendmsg()
- Clear the end mark of elements added by bpf_msg_push_data() and bpf_msg_pop_data()
- Fix ring capacity invariant break in bpf_msg_push_data() (Bo Cao)
- Report RCU-tasks quiescent states in do_check() to fix rcu_tasks stalls during a long verification (Breno Leitao)
- Various sockmap fixes (Chris Mason):
- Give no progs to a TCP listener
- Check the target of an egress redirect before each send
- Check the TCP state in recvmsg()
- Reset the copy position when corking
- Don't copy 0 bytes into a full cork
- Use a dedicated workqueue for freeing BPF programs to fix a deadlock between pack_mutex waiters and the vmalloc purge work (Emil Tsalapatis)
- Fix verifier model mismatch on a narrow read of
__sk_buff.remote_port (Henry Martin)
- Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate selftest (Jiayuan Chen)
- Restrict uprobe ctx writes to the registers that ptrace can set (Jiri Olsa)
- Various sockmap fixes (Josef Bacik):
- Write sg.start when recvmsg() faults
- Don't let an SK_DROP verdict stick
- Clear the resume state of a stopped psock
- Various fixes (Michal Luczaj):
- Fix "unresolved symbol tcp_request_sock" build error with CONFIG_INET=n
- Restrict iter-context sockmap updates to iter/sockmap
- Restrict bpf_sock_destroy() to iter/{tcp,udp}
- Mark bpf_iter__sockmap::sk as PTR_TRUSTED
- Mark backing_file_alloc/free LSM hooks as untrusted (Sergei Nizovtsev)
- Various cgroup-bpf fixes (Shakeel Butt):
- Don't read freed effective arrays in BPF_PROG_QUERY
- Don't attach to a removed cgroup
- Protect cgroup_bpf state with its own mutex, so that queries and the release work don't wait for cgroup_mutex
- Don't lose errors in effective BPF_LSM_CGROUP queries
- Check variable-offset accesses against special fields (Shihuang Liu)
----------------------------------------------------------------
Adethya Srinivasan (2):
bpf: Reject writable map iterators on read-only maps selftests/bpf: Check writable iterator attach to a read-only array
Alexei Starovoitov (12):
bpf, sockmap: Don't let an SK_PASS verdict cover the next message
bpf, sockmap: Subtract all dropped bytes from the return value
net: Leave sk_stream_wait_memory() once the socket is dead
bpf, sockmap: Clear the redirect target before the sk_msg prog runs bpf, sockmap: Check that the redirected message is the cork
bpf, sockmap: Keep the rest of the cork after a redirect
bpf, sockmap: Clear the end mark of elements added by push and pop Merge branch 'bpf-sockmap-fixes-for-verdicts-redirects-corks-and-recvmsg' Merge branch 'reject-writable-map-iterators-on-read-only-maps'
Merge branch 'bpf-sockmap-restrict-iter-context-sockmap-updates-to-sockmap-iterators' Merge branch 'bpf-cgroup-don-t-wait-for-cgroup_mutex-to-read-or-free-cgroup-bpf-state' Merge branch 'bpf-limit-writable-registers-in-uprobe-context'
Bo Cao (1):
bpf, sockmap: Fix ring capacity invariant break in bpf_msg_push_data()
Breno Leitao (1):
bpf: Report RCU-tasks quiescent states in do_check()
Chris Mason (5):
bpf, sockmap: Give no progs to a TCP listener
bpf, sockmap: Check the target of an egress redirect before each send bpf, sockmap: Check the TCP state in recvmsg()
bpf, sockmap: Reset the copy position when corking
bpf, sockmap: Don't copy 0 bytes into a full cork
Emil Tsalapatis (1):
bpf: Use dedicated workqueue for freeing BPF programs
Henry Martin (1):
bpf: Fix verifier model mismatch on __sk_buff.remote_port narrow read
Jiayuan Chen (1):
selftests/bpf: Fix bpf-gcc CO-RE relocation in verifier_sockmap_mutate
Jiri Olsa (2):
bpf: Restrict uprobe ctx writes to the registers ptrace can set selftests/bpf: Test which ctx registers a uprobe prog can write
Josef Bacik (3):
bpf, sockmap: Write sg.start when recvmsg() faults bpf, sockmap: Don't let an SK_DROP verdict stick bpf, sockmap: Clear the resume state of a stopped psock
Michal Luczaj (8):
selftests/bpf: Remove sockmap update from bpf_iter_unix
bpf, sockmap: Restrict iter-context sockmap updates to iter/sockmap selftests/bpf: Add negative test for sockmap update from non-sockmap iter bpf, docs: Document BPF_ITER_NOSLEEP
bpf: Restrict bpf_sock_destroy() to iter/{tcp,udp}
bpf: Mark bpf_iter__sockmap::sk as PTR_TRUSTED selftests/bpf: Add iter/sockmap bpf_sock_destroy() negative test
bpf: Fix "unresolved symbol tcp_request_sock" build error
Sergei Nizovtsev (1):
bpf, lsm: Mark backing_file_alloc/free LSM hooks as untrusted
Shakeel Butt (4):
bpf, cgroup: Don't read freed effective arrays in BPF_PROG_QUERY bpf, cgroup: Don't attach to a removed cgroup
bpf, cgroup: Protect cgroup_bpf state with its own mutex bpf, cgroup: Don't lose errors in effective BPF_LSM_CGROUP queries
Shihuang Liu (1):
bpf: Check variable-offset accesses against special fields
Documentation/bpf/bpf_iterators.rst | 12 +- Documentation/bpf/map_sockmap.rst | 4 +- arch/arm64/kernel/probes/uprobes.c | 6 + arch/riscv/kernel/probes/uprobes.c | 6 + arch/x86/kernel/uprobes.c | 15 ++ include/linux/bpf-cgroup-defs.h | 1 + include/linux/bpf-cgroup.h | 3 + include/linux/bpf.h | 1 + include/linux/skmsg.h | 19 ++ include/linux/uprobes.h | 5 + include/net/tcp.h | 6 + kernel/bpf/bpf_lsm.c | 2 + kernel/bpf/btf.c | 7 +- kernel/bpf/cgroup.c | 163 ++++++++++++----- kernel/bpf/core.c | 20 ++- kernel/bpf/local_storage.c | 8 +- kernel/bpf/map_iter.c | 12 +- kernel/bpf/trampoline.c | 2 +- kernel/bpf/verifier.c | 7 +- kernel/events/uprobes.c | 9 + kernel/trace/bpf_trace.c | 10 +- net/core/filter.c | 54 +++--- net/core/skmsg.c | 13 +- net/core/sock_map.c | 11 +- net/core/stream.c | 6 +- net/ipv4/tcp_bpf.c | 93 +++++++++- net/mptcp/protocol.c | 6 - tools/testing/selftests/bpf/prog_tests/bpf_iter.c | 35 ++++ tools/testing/selftests/bpf/prog_tests/verifier.c | 2 + tools/testing/selftests/bpf/progs/bpf_iter_unix.c | 10 -- .../selftests/bpf/progs/sock_destroy_prog_fail.c | 11 ++ .../selftests/bpf/progs/verifier_sockmap_mutate.c | 17 +- .../bpf/progs/verifier_uprobe_write_ctx.c | 196 +++++++++++++++++++++ 33 files changed, 652 insertions(+), 120 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/verifier_uprobe_write_ctx.c
The pull request you sent on Fri, 20 Nov 2026 20:09:48 +0000:
The pull request you sent on Fri, 20 Nov 2026 20:09:48 +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/84afebd853437e44cb71f718be11d90e4c1a59dd
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, 20 Nov 2026 20:09:48 +0000 you wrote:
Hi Linus,
The following changes since commit
05441d697f7f9a927264f4058cbbc6a03dfcac9d:Merge tag 'cocci-7.4-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux(2026-11-03 08:36:32 -0800)are available in the Git repository at:
[...]
Here is the summary with links:
- [GIT,PULL] BPF fixes for 7.4-rc4
https://git.kernel.org/bpf/bpf/c/84afebd85343
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html