Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /* Copyright (c) 2021 Google LLC. */
0003 
0004 #include <linux/bpf.h>
0005 #include <bpf/bpf_helpers.h>
0006 
0007 /* The format string is filled from the userspace such that loading fails */
0008 const char fmt[10];
0009 
0010 SEC("raw_tp/sys_enter")
0011 int handler(const void *ctx)
0012 {
0013     unsigned long long arg = 42;
0014 
0015     bpf_snprintf(NULL, 0, fmt, &arg, sizeof(arg));
0016 
0017     return 0;
0018 }
0019 
0020 char _license[] SEC("license") = "GPL";