Something went wrong. Try again.
(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106// SPDX-License-Identifier: GPL-2.0/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
#include <vmlinux.h>#include <bpf/bpf_helpers.h>#include "bpf_misc.h"
#if defined(__BPF_FEATURE_STACK_ARGUMENT)
SEC("socket")__description("r11 in ALU instruction")__failure __msg("R11 is invalid")__naked void r11_alu_reject(void){ asm volatile ( "r11 += 1;" "r0 = 0;" "exit;" ::: __clobber_all);}
SEC("socket")__description("r11 store with non-DW size")__failure __msg("R11 is invalid")__naked void r11_store_non_dw(void){ asm volatile ( "*(u32 *)(r11 - 8) = r1;" "r0 = 0;" "exit;" ::: __clobber_all);}
SEC("socket")__description("r11 store with unaligned offset")__failure __msg("R11 is invalid")__naked void r11_store_unaligned(void){ asm volatile ( "*(u64 *)(r11 - 4) = r1;" "r0 = 0;" "exit;" ::: __clobber_all);}
SEC("socket")__description("r11 store with positive offset")__failure __msg("R11 is invalid")__naked void r11_store_positive_off(void){ asm volatile ( "*(u64 *)(r11 + 8) = r1;" "r0 = 0;" "exit;" ::: __clobber_all);}
SEC("socket")__description("r11 load with negative offset")__failure __msg("R11 is invalid")__naked void r11_load_negative_off(void){ asm volatile ( "r0 = *(u64 *)(r11 - 8);" "exit;" ::: __clobber_all);}
SEC("socket")__description("r11 load with non-DW size")__failure __msg("R11 is invalid")__naked void r11_load_non_dw(void){ asm volatile ( "r0 = *(u32 *)(r11 + 8);" "exit;" ::: __clobber_all);}
SEC("socket")__description("r11 store with zero offset")__failure __msg("R11 is invalid")__naked void r11_store_zero_off(void){ asm volatile ( "*(u64 *)(r11 + 0) = r1;" "r0 = 0;" "exit;" ::: __clobber_all);}
#else
SEC("tc")__description("stack_arg_fail: not supported, dummy test")__skip("stack_arg_fail: not supported")__successint dummy_test(struct __sk_buff *skb){ return 0;}
#endif
char _license[] SEC("license") = "GPL";