diff options
| author | Masoud Aghasi <maghasi@disroot.org> | 2026-09-03 09:27:34 +0100 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-13 21:58:40 -0700 |
| commit | 953824e508b27d12837e32ef37ef6248e1f6fc7a (patch) | |
| tree | ecdfc6060d2a09a6f291f75cfb25dd54c076e5f2 /tools/perf/scripts/python/bin/task-analyzer-record | |
| parent | 490a83d6386eec1d29f470c8d7331677fb46c3b7 (diff) | |
| download | linux-next-953824e508b27d12837e32ef37ef6248e1f6fc7a.tar.gz linux-next-953824e508b27d12837e32ef37ef6248e1f6fc7a.zip | |
bpf: Fix u32 overflow issue in map batch operations
Several map batch operation implementations such as
generic_map_lookup_batch() use calculations in the form of
"values + cp * map->value_size" to compute the desired userspace memory
address for reading or writing. This can overflow the u32 type
(the result of "cp * map->value_size") when the map size exceeds 4GB.
generic_map_lookup_batch() may corrupt values for some keys in
userspace memory, and in some cases it mismatches values for some keys
while still reporting success.
Other batch operations may fail to delete or update some keys,
or the syscall may return unexpected errors.
Add size_t casts to prevent the affected offset and size calculations
from overflowing.
Fixes: cb4d03ab499d ("bpf: Add generic support for lookup batch op")
Fixes: aa2e93b8e58e ("bpf: Add generic support for update and delete batch ops")
Fixes: 057996380a42 ("bpf: Add batch ops to all htab bpf map")
Signed-off-by: Masoud Aghasi <maghasi@disroot.org>
Link: https://lore.kernel.org/r/20260903082734.623904-1-maghasi@disroot.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/task-analyzer-record')
0 files changed, 0 insertions, 0 deletions
