diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2026-11-01 01:10:23 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-11-01 01:10:23 +0000 |
| commit | 5b96632457e4ccae88ecb751cf48176b2e3629a7 (patch) | |
| tree | 0a32a475a3f2082565d63de0d713c77bb1687288 /scripts/basic/split-include.c | |
| parent | bcd07fd1673beb873e2bee2731e4ef4d716e70c7 (diff) | |
| parent | 8f92b56d228d8fa4d372f7b410c1ced1e92eb664 (diff) | |
| download | linux-5b96632457e4ccae88ecb751cf48176b2e3629a7.tar.gz linux-5b96632457e4ccae88ecb751cf48176b2e3629a7.zip | |
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/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
