diff options
| author | 2026-11-01 01:10:23 +0000 | |
|---|---|---|
| committer | 2026-11-01 01:10:23 +0000 | |
| commit | 5b96632457e4ccae88ecb751cf48176b2e3629a7 (patch) | |
| tree | 0a32a475a3f2082565d63de0d713c77bb1687288 /scripts/Makefile.thinlto | |
| parent | bpf, sockmap: Fix psock update-side data races on sk->sk_prot and progs (diff) | |
| parent | selftests/bpf: Test overlapping dynptr copies on xdp frags (diff) | |
Merge branch 'bpf-fix-overlapping-copies-in-bpf_dynptr_copy'
Ayushman Rout says:
====================
bpf: Fix overlapping copies in bpf_dynptr_copy()
bpf_dynptr_copy() can corrupt data when both ranges are in the same xdp
packet and overlap: a slice of one range is used as the buffer for
__bpf_dynptr_read() or __bpf_dynptr_write(), and the chunk loop always
copies forward.
Patch 1 does not use a slice as the buffer for a copy within one packet
and copies from the end when the destination is above the source.
Patch 2 adds selftests. They pass with the fix.
Changes in v2:
- Dropped the bpf_xdp_copy_buf() change and fixed everything in
bpf_dynptr_copy(), as suggested by Alexei
- Reworked the tests into bpf_dynptr_copy() tests where only one of the
ranges crosses into frag0
v1: https://lore.kernel.org/bpf/20261024092659.76422-1-ayushmanrout27@gmail.com/
====================
Link: https://patch.msgid.link/20261026162810.12862-1-ayushmanrout27@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
