1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #undef TRACE_SYSTEM 3 #define TRACE_SYSTEM syscall_check 4 5 #define TRACE_INCLUDE_PATH trace/hooks 6 #if !defined(_TRACE_HOOK_SYSCALL_CHECK_H) || defined(TRACE_HEADER_MULTI_READ) 7 #define _TRACE_HOOK_SYSCALL_CHECK_H 8 #include <linux/tracepoint.h> 9 #include <trace/hooks/vendor_hooks.h> 10 /* 11 * Following tracepoints are not exported in tracefs and provide a 12 * mechanism for vendor modules to hook and extend functionality 13 */ 14 #ifdef __GENKSYMS__ 15 struct file; 16 union bpf_attr; 17 #else 18 /* struct file */ 19 #include <linux/fs.h> 20 /* union bpf_attr */ 21 #include <uapi/linux/bpf.h> 22 #endif /* __GENKSYMS__ */ 23 DECLARE_HOOK(android_vh_check_mmap_file, 24 TP_PROTO(const struct file *file, unsigned long prot, 25 unsigned long flag, unsigned long ret), 26 TP_ARGS(file, prot, flag, ret)); 27 28 DECLARE_HOOK(android_vh_check_file_open, 29 TP_PROTO(const struct file *file), 30 TP_ARGS(file)); 31 32 DECLARE_HOOK(android_vh_check_bpf_syscall, 33 TP_PROTO(int cmd, const union bpf_attr *attr, unsigned int size), 34 TP_ARGS(cmd, attr, size)); 35 36 #endif /* _TRACE_HOOK_SYSCALL_CHECK_H */ 37 /* This part must be outside protection */ 38 #include <trace/define_trace.h> 39