]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Replace kvfree with kfree for kzalloc memory
authorQianfeng Rong <rongqianfeng@vivo.com>
Mon, 11 Aug 2025 12:39:49 +0000 (20:39 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 12 Aug 2025 22:55:01 +0000 (15:55 -0700)
commitbf0c2a84df9fb0f7779eb24c30198ef93f292e66
treefa371fc47805e8a70f894c99a316bfbd39a6a245
parentc93c59baa5ab57e94b874000cec56e26611b7a23
bpf: Replace kvfree with kfree for kzalloc memory

The 'backedge' pointer is allocated with kzalloc(), which returns
physically contiguous memory. Using kvfree() to deallocate such
memory is functionally safe but semantically incorrect.

Replace kvfree() with kfree() to avoid unnecessary is_vmalloc_addr()
check in kvfree().

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20250811123949.552885-1-rongqianfeng@vivo.com
kernel/bpf/verifier.c