mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-23 14:24:25 +08:00
selftests/bpf: validate .bss section bigger than 8MB is possible now
Add a simple big 16MB array and validate access to the very last byte of it to make sure that kernel supports > KMALLOC_MAX_SIZE value_size for BPF array maps (which are backing .bss in this case). Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20220715053146.1291891-5-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
63b8ce77b1
commit
2431646120
@ -122,6 +122,8 @@ void test_skeleton(void)
|
||||
|
||||
ASSERT_EQ(skel->bss->out_mostly_var, 123, "out_mostly_var");
|
||||
|
||||
ASSERT_EQ(bss->huge_arr[ARRAY_SIZE(bss->huge_arr) - 1], 123, "huge_arr");
|
||||
|
||||
elf_bytes = test_skeleton__elf_bytes(&elf_bytes_sz);
|
||||
ASSERT_OK_PTR(elf_bytes, "elf_bytes");
|
||||
ASSERT_GE(elf_bytes_sz, 0, "elf_bytes_sz");
|
||||
|
@ -51,6 +51,8 @@ int out_dynarr[4] SEC(".data.dyn") = { 1, 2, 3, 4 };
|
||||
int read_mostly_var __read_mostly;
|
||||
int out_mostly_var;
|
||||
|
||||
char huge_arr[16 * 1024 * 1024];
|
||||
|
||||
SEC("raw_tp/sys_enter")
|
||||
int handler(const void *ctx)
|
||||
{
|
||||
@ -71,6 +73,8 @@ int handler(const void *ctx)
|
||||
|
||||
out_mostly_var = read_mostly_var;
|
||||
|
||||
huge_arr[sizeof(huge_arr) - 1] = 123;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user