diff options
| author | 2021-09-28 16:27:18 -0700 | |
|---|---|---|
| committer | 2021-09-28 16:27:19 -0700 | |
| commit | 72e1781a5de9e3ee804e24f7ce9a7dd85596fc51 (patch) | |
| tree | 18cfa723e40dbe24928faf0299bf0b90e8df9f43 /lib/test_bpf.c | |
| parent | bpftool: Avoid using "?: " in generated code (diff) | |
| parent | bpf: Replace callers of BPF_CAST_CALL with proper function typedef (diff) | |
| download | linux-dev-72e1781a5de9e3ee804e24f7ce9a7dd85596fc51.tar.xz linux-dev-72e1781a5de9e3ee804e24f7ce9a7dd85596fc51.zip | |
Merge branch 'bpf: Build with -Wcast-function-type'
Kees Cook says:
====================
Hi,
In order to keep ahead of cases in the kernel where Control Flow Integrity
(CFI) may trip over function call casts, enabling -Wcast-function-type
is helpful. To that end, replace BPF_CAST_CALL() as it triggers warnings
with this option and is now one of the last places in the kernel in need
of fixing.
Thanks,
-Kees
v2:
- rebase to bpf-next
- add acks
v1: https://lore.kernel.org/lkml/20210927182700.2980499-1-keescook@chromium.org
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'lib/test_bpf.c')
| -rw-r--r-- | lib/test_bpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c index 08f438e6fe9e..21ea1ab253a1 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -12439,7 +12439,7 @@ static __init int prepare_tail_call_tests(struct bpf_array **pprogs) err = -EFAULT; goto out_err; } - *insn = BPF_EMIT_CALL(BPF_CAST_CALL(addr)); + *insn = BPF_EMIT_CALL(addr); if ((long)__bpf_call_base + insn->imm != addr) *insn = BPF_JMP_A(0); /* Skip: NOP */ break; |
