1
0
Fork 0
linux/tools/testing/selftests/bpf/progs/test_log_buf.c
Daniel Baumann 79d69e5050
Adding upstream version 6.12.33.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 12:14:28 +02:00

24 lines
407 B
C

// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2021 Facebook */
#include <linux/bpf.h>
#include <bpf/bpf_helpers.h>
int a[4];
const volatile int off = 4000;
SEC("raw_tp/sys_enter")
int good_prog(const void *ctx)
{
a[0] = (int)(long)ctx;
return a[1];
}
SEC("raw_tp/sys_enter")
int bad_prog(const void *ctx)
{
/* out of bounds access */
return a[off];
}
char _license[] SEC("license") = "GPL";