diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-09-12 03:04:40 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-09-12 03:04:40 -0400 |
commit | e65e1fc2d24b09c496af76e9c5253ac30b300a89 (patch) | |
tree | b8f88773afd81ab97d5e6b79fc307523bf6b3430 /arch | |
parent | 05ff0e291af086f4325bac76abad250690bbbd63 (diff) |
[PATCH] syscall class hookup for all normal targets
Take default arch/*/kernel/audit.c to lib/, have those with special
needs (== biarch) define AUDIT_ARCH in their Kconfig.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/i386/kernel/audit.c | 51 | ||||
-rw-r--r-- | arch/ia64/Kconfig | 4 | ||||
-rw-r--r-- | arch/powerpc/Kconfig | 4 | ||||
-rw-r--r-- | arch/s390/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86_64/Kconfig | 4 |
6 files changed, 16 insertions, 52 deletions
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index ab98fc21a541..5427a842e841 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile | |||
@@ -39,7 +39,6 @@ obj-$(CONFIG_VM86) += vm86.o | |||
39 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 39 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
40 | obj-$(CONFIG_HPET_TIMER) += hpet.o | 40 | obj-$(CONFIG_HPET_TIMER) += hpet.o |
41 | obj-$(CONFIG_K8_NB) += k8.o | 41 | obj-$(CONFIG_K8_NB) += k8.o |
42 | obj-$(CONFIG_AUDIT) += audit.o | ||
43 | 42 | ||
44 | EXTRA_AFLAGS := -traditional | 43 | EXTRA_AFLAGS := -traditional |
45 | 44 | ||
diff --git a/arch/i386/kernel/audit.c b/arch/i386/kernel/audit.c deleted file mode 100644 index 3b97cff41549..000000000000 --- a/arch/i386/kernel/audit.c +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | #include <linux/init.h> | ||
2 | #include <linux/types.h> | ||
3 | #include <linux/audit.h> | ||
4 | #include <asm/unistd.h> | ||
5 | |||
6 | static unsigned dir_class[] = { | ||
7 | #include <asm-generic/audit_dir_write.h> | ||
8 | ~0U | ||
9 | }; | ||
10 | |||
11 | static unsigned read_class[] = { | ||
12 | #include <asm-generic/audit_read.h> | ||
13 | ~0U | ||
14 | }; | ||
15 | |||
16 | static unsigned write_class[] = { | ||
17 | #include <asm-generic/audit_write.h> | ||
18 | ~0U | ||
19 | }; | ||
20 | |||
21 | static unsigned chattr_class[] = { | ||
22 | #include <asm-generic/audit_change_attr.h> | ||
23 | ~0U | ||
24 | }; | ||
25 | |||
26 | int audit_classify_syscall(int abi, unsigned syscall) | ||
27 | { | ||
28 | switch(syscall) { | ||
29 | case __NR_open: | ||
30 | return 2; | ||
31 | case __NR_openat: | ||
32 | return 3; | ||
33 | case __NR_socketcall: | ||
34 | return 4; | ||
35 | case __NR_execve: | ||
36 | return 5; | ||
37 | default: | ||
38 | return 0; | ||
39 | } | ||
40 | } | ||
41 | |||
42 | static int __init audit_classes_init(void) | ||
43 | { | ||
44 | audit_register_class(AUDIT_CLASS_WRITE, write_class); | ||
45 | audit_register_class(AUDIT_CLASS_READ, read_class); | ||
46 | audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); | ||
47 | audit_register_class(AUDIT_CLASS_CHATTR, chattr_class); | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | __initcall(audit_classes_init); | ||
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 674de8943478..db274da7dba1 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -75,6 +75,10 @@ config DMA_IS_NORMAL | |||
75 | depends on IA64_SGI_SN2 | 75 | depends on IA64_SGI_SN2 |
76 | default y | 76 | default y |
77 | 77 | ||
78 | config AUDIT_ARCH | ||
79 | bool | ||
80 | default y | ||
81 | |||
78 | choice | 82 | choice |
79 | prompt "System type" | 83 | prompt "System type" |
80 | default IA64_GENERIC | 84 | default IA64_GENERIC |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 4d4b6fb156e1..694b0c63ee50 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -95,6 +95,10 @@ config GENERIC_TBSYNC | |||
95 | default y if PPC32 && SMP | 95 | default y if PPC32 && SMP |
96 | default n | 96 | default n |
97 | 97 | ||
98 | config AUDIT_ARCH | ||
99 | bool | ||
100 | default y | ||
101 | |||
98 | config DEFAULT_UIMAGE | 102 | config DEFAULT_UIMAGE |
99 | bool | 103 | bool |
100 | help | 104 | help |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index ae071a11ce71..2f4f70c4dbb2 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -118,6 +118,10 @@ config SYSVIPC_COMPAT | |||
118 | depends on COMPAT && SYSVIPC | 118 | depends on COMPAT && SYSVIPC |
119 | default y | 119 | default y |
120 | 120 | ||
121 | config AUDIT_ARCH | ||
122 | bool | ||
123 | default y | ||
124 | |||
121 | comment "Code generation options" | 125 | comment "Code generation options" |
122 | 126 | ||
123 | choice | 127 | choice |
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 28df7d88ce2c..6cd4878625f1 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -85,6 +85,10 @@ config DMI | |||
85 | bool | 85 | bool |
86 | default y | 86 | default y |
87 | 87 | ||
88 | config AUDIT_ARCH | ||
89 | bool | ||
90 | default y | ||
91 | |||
88 | source "init/Kconfig" | 92 | source "init/Kconfig" |
89 | 93 | ||
90 | 94 | ||