Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Verifier tests for single- and multi-level pointer parameter handling
4 * Copyright (c) 2026 CrowdStrike, Inc.
5 */
6
7#include <linux/bpf.h>
8#include <bpf/bpf_helpers.h>
9#include <bpf/bpf_tracing.h>
10#include "bpf_misc.h"
11
12SEC("fentry/bpf_fentry_test_ppvoid")
13__description("fentry/void**: void ** inferred as scalar")
14__success __retval(0)
15__log_level(2)
16__msg("R1=ctx() R2=scalar()")
17__naked void fentry_ppvoid_as_scalar(void)
18{
19 asm volatile (" \
20 r2 = *(u64 *)(r1 + 0); \
21 r0 = 0; \
22 exit; \
23 " ::: __clobber_all);
24}
25
26SEC("fentry/bpf_fentry_test_pppvoid")
27__description("fentry/void***: void *** inferred as scalar")
28__success __retval(0)
29__log_level(2)
30__msg("R1=ctx() R2=scalar()")
31__naked void fentry_pppvoid_as_scalar(void)
32{
33 asm volatile (" \
34 r2 = *(u64 *)(r1 + 0); \
35 r0 = 0; \
36 exit; \
37 " ::: __clobber_all);
38}
39
40SEC("fentry/bpf_fentry_test_ppfile")
41__description("fentry/struct file**: struct file ** inferred as scalar")
42__success __retval(0)
43__log_level(2)
44__msg("R1=ctx() R2=scalar()")
45__naked void fentry_ppfile_as_scalar(void)
46{
47 asm volatile (" \
48 r2 = *(u64 *)(r1 + 0); \
49 r0 = 0; \
50 exit; \
51 " ::: __clobber_all);
52}
53
54SEC("fexit/bpf_fexit_test_ret_ppfile")
55__description("fexit/return struct file**: returned struct file ** inferred as scalar")
56__success __retval(0)
57__log_level(2)
58__msg("R1=ctx() R2=scalar()")
59__naked void fexit_ppfile_as_scalar(void)
60{
61 asm volatile (" \
62 r2 = *(u64 *)(r1 + 0); \
63 r0 = 0; \
64 exit; \
65 " ::: __clobber_all);
66}
67
68char _license[] SEC("license") = "GPL";