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-only
2#include <stddef.h>
3#include <linux/bpf.h>
4#include <bpf/bpf_helpers.h>
5#include "bpf_misc.h"
6
7__noinline int foo(unsigned int *v)
8{
9 if (v)
10 *v = bpf_get_prandom_u32();
11
12 return 0;
13}
14
15SEC("cgroup_skb/ingress")
16__failure __msg("At program exit the register R0 has value")
17int global_func15(struct __sk_buff *skb)
18{
19 unsigned int v = 1;
20
21 foo(&v);
22
23 return v;
24}