mirror of
https://github.com/torvalds/linux.git
synced 2026-04-23 00:55:48 -04:00
Adding test to check we can't attach kprobe multi program that writes to the context. It's x86_64 specific test. Acked-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/r/20250916215301.664963-7-jolsa@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
23 lines
378 B
C
23 lines
378 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";
|
|
|
|
#if defined(__TARGET_ARCH_x86)
|
|
SEC("kprobe")
|
|
int kprobe_write_ctx(struct pt_regs *ctx)
|
|
{
|
|
ctx->ax = 0;
|
|
return 0;
|
|
}
|
|
|
|
SEC("kprobe.multi")
|
|
int kprobe_multi_write_ctx(struct pt_regs *ctx)
|
|
{
|
|
ctx->ax = 0;
|
|
return 0;
|
|
}
|
|
#endif
|