1 // SPDX-License-Identifier: GPL-2.0
2 /* Converted from tools/testing/selftests/bpf/verifier/unpriv.c */
5 #include <bpf/bpf_helpers.h>
9 __description("unpriv: spill/fill of different pointers ldx")
10 __failure __msg("same insn cannot be used with different pointers")
11 __naked void fill_of_different_pointers_ldx(void)
16 if r1 == 0 goto l0_%=; \
19 *(u64*)(r6 + 0) = r2; \
20 l0_%=: if r1 != 0 goto l1_%=; \
21 *(u64*)(r6 + 0) = r1; \
22 l1_%=: r1 = *(u64*)(r6 + 0); \
23 r1 = *(u64*)(r1 + %[sample_period]); \
27 : __imm_const(__imm_0,
28 -(__s32) offsetof(struct bpf_perf_event_data, sample_period) - 8),
29 __imm_const(sample_period,
30 offsetof(struct bpf_perf_event_data, sample_period))
34 char _license[] SEC("license") = "GPL";