Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.17-rc2 34 lines 681 B view raw
1// SPDX-License-Identifier: GPL-2.0 2/* Copyright (c) 2024 Huawei Technologies Co., Ltd */ 3 4#include "vmlinux.h" 5#include <errno.h> 6#include <bpf/bpf_helpers.h> 7 8char _license[] SEC("license") = "GPL"; 9 10struct { 11 __uint(type, BPF_MAP_TYPE_PROG_ARRAY); 12 __uint(max_entries, 1); 13 __uint(key_size, sizeof(__u32)); 14 __uint(value_size, sizeof(__u32)); 15} jmp_table SEC(".maps"); 16 17SEC("lsm/file_permission") 18int lsm_file_permission_prog(void *ctx) 19{ 20 return 0; 21} 22 23SEC("lsm/file_alloc_security") 24int lsm_file_alloc_security_prog(void *ctx) 25{ 26 return 0; 27} 28 29SEC("lsm/file_alloc_security") 30int lsm_file_alloc_security_entry(void *ctx) 31{ 32 bpf_tail_call_static(ctx, &jmp_table, 0); 33 return 0; 34}