Loading...
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/init.h>
3#include <linux/types.h>
4#include <asm/unistd32.h>
5
6unsigned compat_dir_class[] = {
7#include <asm-generic/audit_dir_write.h>
8~0U
9};
10
11unsigned compat_read_class[] = {
12#include <asm-generic/audit_read.h>
13~0U
14};
15
16unsigned compat_write_class[] = {
17#include <asm-generic/audit_write.h>
18~0U
19};
20
21unsigned compat_chattr_class[] = {
22#include <asm-generic/audit_change_attr.h>
23~0U
24};
25
26unsigned compat_signal_class[] = {
27#include <asm-generic/audit_signal.h>
28~0U
29};
30
31int audit_classify_compat_syscall(int abi, unsigned syscall)
32{
33 switch (syscall) {
34#ifdef __NR_open
35 case __NR_open:
36 return 2;
37#endif
38#ifdef __NR_openat
39 case __NR_openat:
40 return 3;
41#endif
42#ifdef __NR_socketcall
43 case __NR_socketcall:
44 return 4;
45#endif
46 case __NR_execve:
47 return 5;
48 default:
49 return 1;
50 }
51}
1#include <linux/init.h>
2#include <linux/types.h>
3#include <asm/unistd32.h>
4
5unsigned compat_dir_class[] = {
6#include <asm-generic/audit_dir_write.h>
7~0U
8};
9
10unsigned compat_read_class[] = {
11#include <asm-generic/audit_read.h>
12~0U
13};
14
15unsigned compat_write_class[] = {
16#include <asm-generic/audit_write.h>
17~0U
18};
19
20unsigned compat_chattr_class[] = {
21#include <asm-generic/audit_change_attr.h>
22~0U
23};
24
25unsigned compat_signal_class[] = {
26#include <asm-generic/audit_signal.h>
27~0U
28};
29
30int audit_classify_compat_syscall(int abi, unsigned syscall)
31{
32 switch (syscall) {
33#ifdef __NR_open
34 case __NR_open:
35 return 2;
36#endif
37#ifdef __NR_openat
38 case __NR_openat:
39 return 3;
40#endif
41#ifdef __NR_socketcall
42 case __NR_socketcall:
43 return 4;
44#endif
45 case __NR_execve:
46 return 5;
47 default:
48 return 1;
49 }
50}