mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-11 04:20:06 +00:00
Add two tests to ensure fentry programs cannot attach to
bpf_spin_{lock,unlock}() helpers. The tracing_failure.c files
can be used in the future for other tracing failure cases.
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240207070107.335341-1-yonghong.song@linux.dev
21 lines
427 B
C
21 lines
427 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/* Copyright (c) 2024 Meta Platforms, Inc. and affiliates. */
|
|
|
|
#include "vmlinux.h"
|
|
#include <bpf/bpf_helpers.h>
|
|
#include <bpf/bpf_tracing.h>
|
|
|
|
char _license[] SEC("license") = "GPL";
|
|
|
|
SEC("?fentry/bpf_spin_lock")
|
|
int BPF_PROG(test_spin_lock, struct bpf_spin_lock *lock)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
SEC("?fentry/bpf_spin_unlock")
|
|
int BPF_PROG(test_spin_unlock, struct bpf_spin_lock *lock)
|
|
{
|
|
return 0;
|
|
}
|