1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */ 3 #include <vmlinux.h> 4 #include <bpf/bpf_tracing.h> 5 #include <bpf/bpf_helpers.h> 6 #include <bpf/bpf_core_read.h> 7 #include "bpf_misc.h" 8 9 SEC("syscall") 10 __failure __msg("Possibly NULL pointer passed") 11 int stream_vprintk_null_arg(void *ctx) 12 { 13 bpf_stream_vprintk(BPF_STDOUT, "", NULL, 0, NULL); 14 return 0; 15 } 16 17 SEC("syscall") 18 __failure __msg("R3 type=scalar expected=") 19 int stream_vprintk_scalar_arg(void *ctx) 20 { 21 bpf_stream_vprintk(BPF_STDOUT, "", (void *)46, 0, NULL); 22 return 0; 23 } 24 25 SEC("syscall") 26 __failure __msg("arg#1 doesn't point to a const string") 27 int stream_vprintk_string_arg(void *ctx) 28 { 29 bpf_stream_vprintk(BPF_STDOUT, ctx, NULL, 0, NULL); 30 return 0; 31 } 32 33 char _license[] SEC("license") = "GPL"; 34