18b08807dSDmitrii Banshchikov // SPDX-License-Identifier: GPL-2.0-only 28b08807dSDmitrii Banshchikov #include <stddef.h> 38b08807dSDmitrii Banshchikov #include <linux/bpf.h> 48b08807dSDmitrii Banshchikov #include <bpf/bpf_helpers.h> 5*95ebb376SAndrii Nakryiko #include "bpf_misc.h" 68b08807dSDmitrii Banshchikov 78b08807dSDmitrii Banshchikov struct S; 88b08807dSDmitrii Banshchikov foo(const struct S * s)98b08807dSDmitrii Banshchikov__noinline int foo(const struct S *s) 108b08807dSDmitrii Banshchikov { 118b08807dSDmitrii Banshchikov if (s) 128b08807dSDmitrii Banshchikov return bpf_get_prandom_u32() < *(const int *) s; 138b08807dSDmitrii Banshchikov 148b08807dSDmitrii Banshchikov return 0; 158b08807dSDmitrii Banshchikov } 168b08807dSDmitrii Banshchikov 178b08807dSDmitrii Banshchikov SEC("cgroup_skb/ingress") 18*95ebb376SAndrii Nakryiko __failure __msg("reference type('FWD S') size cannot be determined") global_func14(struct __sk_buff * skb)19*95ebb376SAndrii Nakryikoint global_func14(struct __sk_buff *skb) 208b08807dSDmitrii Banshchikov { 218b08807dSDmitrii Banshchikov 228b08807dSDmitrii Banshchikov return foo(NULL); 238b08807dSDmitrii Banshchikov } 24