]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Introduce bpf_arch_text_invalidate for bpf_prog_pack
authorSong Liu <song@kernel.org>
Fri, 20 May 2022 23:57:53 +0000 (16:57 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 May 2022 21:08:11 +0000 (23:08 +0200)
commit4bd39d9dea5c295f81f8589d2eacd42c491b7456
tree36163c41f35163deb7c0604f8561b3074967bf47
parentff95c3ee4eaec57304f5702a1a1ffa942a6405c9
bpf: Introduce bpf_arch_text_invalidate for bpf_prog_pack

Introduce bpf_arch_text_invalidate and use it to fill unused part of the
bpf_prog_pack with illegal instructions when a BPF program is freed.

Fixes: 0a066f82325a ("bpf: Introduce bpf_prog_pack allocator")
Fixes: d69eaf2dbc24 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]")
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220520235758.1858153-4-song@kernel.org
arch/x86/net/bpf_jit_comp.c
include/linux/bpf.h
kernel/bpf/core.c