1 // SPDX-License-Identifier: GPL-2.0 2 3 #include <vmlinux.h> 4 #include <bpf/bpf_helpers.h> 5 6 SEC("?freplace") changes_pkt_data(struct __sk_buff * sk)7long changes_pkt_data(struct __sk_buff *sk) 8 { 9 return bpf_skb_pull_data(sk, 0); 10 } 11 12 SEC("?freplace") does_not_change_pkt_data(struct __sk_buff * sk)13long does_not_change_pkt_data(struct __sk_buff *sk) 14 { 15 return 0; 16 } 17 18 SEC("?freplace") might_sleep(struct pt_regs * ctx)19long might_sleep(struct pt_regs *ctx) 20 { 21 int i; 22 23 bpf_copy_from_user(&i, sizeof(i), NULL); 24 return i; 25 } 26 27 SEC("?freplace") does_not_sleep(struct pt_regs * ctx)28long does_not_sleep(struct pt_regs *ctx) 29 { 30 return 0; 31 } 32 33 char _license[] SEC("license") = "GPL"; 34