mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-16 06:51:42 +00:00
Cross-merge bpf fixes after downstream PR. No conflicts. Adjacent changes in: Auto-merging include/linux/bpf.h Auto-merging include/linux/bpf_verifier.h Auto-merging kernel/bpf/btf.c Auto-merging kernel/bpf/verifier.c Auto-merging kernel/trace/bpf_trace.c Auto-merging tools/testing/selftests/bpf/progs/test_tp_btf_nullable.c Signed-off-by: Alexei Starovoitov <ast@kernel.org>
25 lines
649 B
C
25 lines
649 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#include "vmlinux.h"
|
|
#include <bpf/bpf_helpers.h>
|
|
#include <bpf/bpf_tracing.h>
|
|
#include "../test_kmods/bpf_testmod.h"
|
|
#include "bpf_misc.h"
|
|
|
|
SEC("tp_btf/bpf_testmod_test_nullable_bare")
|
|
__failure __msg("R1 invalid mem access 'trusted_ptr_or_null_'")
|
|
int BPF_PROG(handle_tp_btf_nullable_bare1, struct bpf_testmod_test_read_ctx *nullable_ctx)
|
|
{
|
|
return nullable_ctx->len;
|
|
}
|
|
|
|
SEC("tp_btf/bpf_testmod_test_nullable_bare")
|
|
int BPF_PROG(handle_tp_btf_nullable_bare2, struct bpf_testmod_test_read_ctx *nullable_ctx)
|
|
{
|
|
if (nullable_ctx)
|
|
return nullable_ctx->len;
|
|
return 0;
|
|
}
|
|
|
|
char _license[] SEC("license") = "GPL";
|