mirror of
https://github.com/torvalds/linux.git
synced 2026-09-27 02:22:02 +02:00
Add a test to verify that the sleepable tracing prog cannot attach to a '__x64_sys' prefix prog target. When CONFIG_FUNCTION_ERROR_INJECTION is disabled, without the fix, the test would trigger the BUG: [ 3.460756] BUG: sleeping function called from invalid context at kernel/bpf/trampoline.c:1324 Signed-off-by: Leon Hwang <leon.hwang@linux.dev> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20260805150810.34907-3-leon.hwang@linux.dev
19 lines
318 B
C
19 lines
318 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include "vmlinux.h"
|
|
#include <bpf/bpf_helpers.h>
|
|
#include <bpf/bpf_tracing.h>
|
|
|
|
char LICENSE[] SEC("license") = "GPL";
|
|
|
|
void *user_ptr;
|
|
int retval;
|
|
|
|
SEC("fentry.s")
|
|
int BPF_PROG(fentry_xdp)
|
|
{
|
|
char buff[64];
|
|
|
|
retval = bpf_copy_from_user(buff, sizeof(buff), user_ptr);
|
|
return 0;
|
|
}
|