-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel…
…/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-06-21 We've added 7 non-merge commits during the last 14 day(s) which contain a total of 7 files changed, 181 insertions(+), 15 deletions(-). The main changes are: 1) Fix a verifier id tracking issue with scalars upon spill, from Maxim Mikityanskiy. 2) Fix NULL dereference if an exception is generated while a BPF subprogram is running, from Krister Johansen. 3) Fix a BTF verification failure when compiling kernel with LLVM_IAS=0, from Florent Revest. 4) Fix expected_attach_type enforcement for kprobe_multi link, from Jiri Olsa. 5) Fix a bpf_jit_dump issue for x86_64 to pick the correct JITed image, from Yonghong Song. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Force kprobe multi expected_attach_type for kprobe_multi link bpf/btf: Accept function names that contain dots selftests/bpf: add a test for subprogram extables bpf: ensure main program has an extable bpf: Fix a bpf_jit_dump issue for x86_64 with sysctl bpf_jit_enable. selftests/bpf: Add test cases to assert proper ID tracking on spill bpf: Fix verifier id tracking of scalars on spill ==================== Link: https://lore.kernel.org/r/20230621101116.16122-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Showing
7 changed files
with
181 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
#include <test_progs.h> | ||
#include "test_subprogs_extable.skel.h" | ||
|
||
void test_subprogs_extable(void) | ||
{ | ||
const int read_sz = 456; | ||
struct test_subprogs_extable *skel; | ||
int err; | ||
|
||
skel = test_subprogs_extable__open_and_load(); | ||
if (!ASSERT_OK_PTR(skel, "skel_open_and_load")) | ||
return; | ||
|
||
err = test_subprogs_extable__attach(skel); | ||
if (!ASSERT_OK(err, "skel_attach")) | ||
goto cleanup; | ||
|
||
/* trigger tracepoint */ | ||
ASSERT_OK(trigger_module_test_read(read_sz), "trigger_read"); | ||
|
||
ASSERT_NEQ(skel->bss->triggered, 0, "verify at least one program ran"); | ||
|
||
test_subprogs_extable__detach(skel); | ||
|
||
cleanup: | ||
test_subprogs_extable__destroy(skel); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
|
||
#include "vmlinux.h" | ||
#include <bpf/bpf_helpers.h> | ||
#include <bpf/bpf_tracing.h> | ||
|
||
struct { | ||
__uint(type, BPF_MAP_TYPE_ARRAY); | ||
__uint(max_entries, 8); | ||
__type(key, __u32); | ||
__type(value, __u64); | ||
} test_array SEC(".maps"); | ||
|
||
unsigned int triggered; | ||
|
||
static __u64 test_cb(struct bpf_map *map, __u32 *key, __u64 *val, void *data) | ||
{ | ||
return 1; | ||
} | ||
|
||
SEC("fexit/bpf_testmod_return_ptr") | ||
int BPF_PROG(handle_fexit_ret_subprogs, int arg, struct file *ret) | ||
{ | ||
*(volatile long *)ret; | ||
*(volatile int *)&ret->f_mode; | ||
bpf_for_each_map_elem(&test_array, test_cb, NULL, 0); | ||
triggered++; | ||
return 0; | ||
} | ||
|
||
SEC("fexit/bpf_testmod_return_ptr") | ||
int BPF_PROG(handle_fexit_ret_subprogs2, int arg, struct file *ret) | ||
{ | ||
*(volatile long *)ret; | ||
*(volatile int *)&ret->f_mode; | ||
bpf_for_each_map_elem(&test_array, test_cb, NULL, 0); | ||
triggered++; | ||
return 0; | ||
} | ||
|
||
SEC("fexit/bpf_testmod_return_ptr") | ||
int BPF_PROG(handle_fexit_ret_subprogs3, int arg, struct file *ret) | ||
{ | ||
*(volatile long *)ret; | ||
*(volatile int *)&ret->f_mode; | ||
bpf_for_each_map_elem(&test_array, test_cb, NULL, 0); | ||
triggered++; | ||
return 0; | ||
} | ||
|
||
char _license[] SEC("license") = "GPL"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters