]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: cleanup aux->used_maps after jit
authorAnton Protopopov <a.s.protopopov@gmail.com>
Mon, 24 Nov 2025 15:15:15 +0000 (15:15 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 24 Nov 2025 17:39:55 +0000 (09:39 -0800)
commitfad804002ef3cae8ca0509849d0d9539be069095
tree578da4233ea5eddef82b543abca090360587c32a
parentc42732087341e3c1ae34b25cc318609cacd866ac
bpf: cleanup aux->used_maps after jit

In commit b4ce5923e780 ("bpf, x86: add new map type: instructions array")
env->used_map was copied to func[i]->aux->used_maps before jitting.
Clear these fields out after jitting such that pointer to freed memory
(env->used_maps is freed later) are not kept in a live data structure.

The reason why the copies were initially added is explained in
https://lore.kernel.org/bpf/20251105090410.1250500-1-a.s.protopopov@gmail.com

Suggested-by: Alexei Starovoitov <ast@kernel.org>
Fixes: b4ce5923e780 ("bpf, x86: add new map type: instructions array")
Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Link: https://lore.kernel.org/r/20251124151515.2543403-1-a.s.protopopov@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c