aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-08-31 19:26:40 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-09-11 13:32:30 -0400
commit55669bfa141b488be865341ed12e188967d11308 (patch)
treeefeec37a93f46c48937eb849c083da9a42ed3709 /arch
parentdc104fb3231f11e95b5a0f09ae3ab27a8fd5b2e8 (diff)
[PATCH] audit: AUDIT_PERM support
add support for AUDIT_PERM predicate Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/audit.c16
-rw-r--r--arch/ia64/ia32/audit.c16
-rw-r--r--arch/ia64/kernel/audit.c19
-rw-r--r--arch/powerpc/kernel/audit.c21
-rw-r--r--arch/powerpc/kernel/compat_audit.c16
-rw-r--r--arch/s390/kernel/audit.c21
-rw-r--r--arch/s390/kernel/compat_audit.c16
-rw-r--r--arch/x86_64/ia32/audit.c16
-rw-r--r--arch/x86_64/kernel/audit.c19
9 files changed, 160 insertions, 0 deletions
diff --git a/arch/i386/kernel/audit.c b/arch/i386/kernel/audit.c
index 28bbc46f75c2..3b97cff41549 100644
--- a/arch/i386/kernel/audit.c
+++ b/arch/i386/kernel/audit.c
@@ -23,6 +23,22 @@ static unsigned chattr_class[] = {
23~0U 23~0U
24}; 24};
25 25
26int 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
26static int __init audit_classes_init(void) 42static int __init audit_classes_init(void)
27{ 43{
28 audit_register_class(AUDIT_CLASS_WRITE, write_class); 44 audit_register_class(AUDIT_CLASS_WRITE, write_class);
diff --git a/arch/ia64/ia32/audit.c b/arch/ia64/ia32/audit.c
index 798501994bd9..92d7d0c8d93f 100644
--- a/arch/ia64/ia32/audit.c
+++ b/arch/ia64/ia32/audit.c
@@ -19,3 +19,19 @@ unsigned ia32_read_class[] = {
19#include <asm-generic/audit_read.h> 19#include <asm-generic/audit_read.h>
20~0U 20~0U
21}; 21};
22
23int ia32_classify_syscall(unsigned syscall)
24{
25 switch(syscall) {
26 case __NR_open:
27 return 2;
28 case __NR_openat:
29 return 3;
30 case __NR_socketcall:
31 return 4;
32 case __NR_execve:
33 return 5;
34 default:
35 return 1;
36 }
37}
diff --git a/arch/ia64/kernel/audit.c b/arch/ia64/kernel/audit.c
index 99488cdbf5cd..04682555a28c 100644
--- a/arch/ia64/kernel/audit.c
+++ b/arch/ia64/kernel/audit.c
@@ -23,6 +23,25 @@ static unsigned chattr_class[] = {
23~0U 23~0U
24}; 24};
25 25
26int audit_classify_syscall(int abi, unsigned syscall)
27{
28#ifdef CONFIG_IA32_SUPPORT
29 extern int ia32_classify_syscall(unsigned);
30 if (abi == AUDIT_ARCH_I386)
31 return ia32_classify_syscall(syscall);
32#endif
33 switch(syscall) {
34 case __NR_open:
35 return 2;
36 case __NR_openat:
37 return 3;
38 case __NR_execve:
39 return 5;
40 default:
41 return 0;
42 }
43}
44
26static int __init audit_classes_init(void) 45static int __init audit_classes_init(void)
27{ 46{
28#ifdef CONFIG_IA32_SUPPORT 47#ifdef CONFIG_IA32_SUPPORT
diff --git a/arch/powerpc/kernel/audit.c b/arch/powerpc/kernel/audit.c
index 24a65e3724e1..7fe5e6300e9a 100644
--- a/arch/powerpc/kernel/audit.c
+++ b/arch/powerpc/kernel/audit.c
@@ -23,6 +23,27 @@ static unsigned chattr_class[] = {
23~0U 23~0U
24}; 24};
25 25
26int audit_classify_syscall(int abi, unsigned syscall)
27{
28#ifdef CONFIG_PPC64
29 extern int ppc32_classify_syscall(unsigned);
30 if (abi == AUDIT_ARCH_PPC)
31 return ppc32_classify_syscall(syscall);
32#endif
33 switch(syscall) {
34 case __NR_open:
35 return 2;
36 case __NR_openat:
37 return 3;
38 case __NR_socketcall:
39 return 4;
40 case __NR_execve:
41 return 5;
42 default:
43 return 0;
44 }
45}
46
26static int __init audit_classes_init(void) 47static int __init audit_classes_init(void)
27{ 48{
28#ifdef CONFIG_PPC64 49#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/compat_audit.c b/arch/powerpc/kernel/compat_audit.c
index ddc0a64896a2..640d4bb29321 100644
--- a/arch/powerpc/kernel/compat_audit.c
+++ b/arch/powerpc/kernel/compat_audit.c
@@ -20,3 +20,19 @@ unsigned ppc32_read_class[] = {
20#include <asm-generic/audit_read.h> 20#include <asm-generic/audit_read.h>
21~0U 21~0U
22}; 22};
23
24int ppc32_classify_syscall(unsigned syscall)
25{
26 switch(syscall) {
27 case __NR_open:
28 return 2;
29 case __NR_openat:
30 return 3;
31 case __NR_socketcall:
32 return 4;
33 case __NR_execve:
34 return 5;
35 default:
36 return 1;
37 }
38}
diff --git a/arch/s390/kernel/audit.c b/arch/s390/kernel/audit.c
index cde57039334c..0741d9193390 100644
--- a/arch/s390/kernel/audit.c
+++ b/arch/s390/kernel/audit.c
@@ -23,6 +23,27 @@ static unsigned chattr_class[] = {
23~0U 23~0U
24}; 24};
25 25
26int audit_classify_syscall(int abi, unsigned syscall)
27{
28#ifdef CONFIG_COMPAT
29 extern int s390_classify_syscall(unsigned);
30 if (abi == AUDIT_ARCH_S390)
31 return s390_classify_syscall(syscall);
32#endif
33 switch(syscall) {
34 case __NR_open:
35 return 2;
36 case __NR_openat:
37 return 3;
38 case __NR_socketcall:
39 return 4;
40 case __NR_execve:
41 return 5;
42 default:
43 return 0;
44 }
45}
46
26static int __init audit_classes_init(void) 47static int __init audit_classes_init(void)
27{ 48{
28#ifdef CONFIG_COMPAT 49#ifdef CONFIG_COMPAT
diff --git a/arch/s390/kernel/compat_audit.c b/arch/s390/kernel/compat_audit.c
index d9e5f3540d48..16d9436bfa91 100644
--- a/arch/s390/kernel/compat_audit.c
+++ b/arch/s390/kernel/compat_audit.c
@@ -20,3 +20,19 @@ unsigned s390_read_class[] = {
20#include <asm-generic/audit_read.h> 20#include <asm-generic/audit_read.h>
21~0U 21~0U
22}; 22};
23
24int s390_classify_syscall(unsigned syscall)
25{
26 switch(syscall) {
27 case __NR_open:
28 return 2;
29 case __NR_openat:
30 return 3;
31 case __NR_socketcall:
32 return 4;
33 case __NR_execve:
34 return 5;
35 default:
36 return 1;
37 }
38}
diff --git a/arch/x86_64/ia32/audit.c b/arch/x86_64/ia32/audit.c
index 798501994bd9..92d7d0c8d93f 100644
--- a/arch/x86_64/ia32/audit.c
+++ b/arch/x86_64/ia32/audit.c
@@ -19,3 +19,19 @@ unsigned ia32_read_class[] = {
19#include <asm-generic/audit_read.h> 19#include <asm-generic/audit_read.h>
20~0U 20~0U
21}; 21};
22
23int ia32_classify_syscall(unsigned syscall)
24{
25 switch(syscall) {
26 case __NR_open:
27 return 2;
28 case __NR_openat:
29 return 3;
30 case __NR_socketcall:
31 return 4;
32 case __NR_execve:
33 return 5;
34 default:
35 return 1;
36 }
37}
diff --git a/arch/x86_64/kernel/audit.c b/arch/x86_64/kernel/audit.c
index 36840acb6513..21f33387bef3 100644
--- a/arch/x86_64/kernel/audit.c
+++ b/arch/x86_64/kernel/audit.c
@@ -23,6 +23,25 @@ static unsigned chattr_class[] = {
23~0U 23~0U
24}; 24};
25 25
26int audit_classify_syscall(int abi, unsigned syscall)
27{
28#ifdef CONFIG_IA32_EMULATION
29 extern int ia32_classify_syscall(unsigned);
30 if (abi == AUDIT_ARCH_I386)
31 return ia32_classify_syscall(syscall);
32#endif
33 switch(syscall) {
34 case __NR_open:
35 return 2;
36 case __NR_openat:
37 return 3;
38 case __NR_execve:
39 return 5;
40 default:
41 return 0;
42 }
43}
44
26static int __init audit_classes_init(void) 45static int __init audit_classes_init(void)
27{ 46{
28#ifdef CONFIG_IA32_EMULATION 47#ifdef CONFIG_IA32_EMULATION