diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2014-03-04 10:38:06 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-09-23 16:21:28 -0400 |
commit | b4f0d3755c5e9cc86292d5fd78261903b4f23d4a (patch) | |
tree | 34cddc7f4fc142be54c487e95335d469eda10e5e | |
parent | a17c8b54dc738c4fda31e8be0302cd131a04c19f (diff) |
audit: x86: drop arch from __audit_syscall_entry() interface
Since the arch is found locally in __audit_syscall_entry(), there is no need to
pass it in as a parameter. Delete it from the parameter list.
x86* was the only arch to call __audit_syscall_entry() directly and did so from
assembly code.
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-audit@redhat.com
Signed-off-by: Eric Paris <eparis@redhat.com>
---
As this patch relies on changes in the audit tree, I think it
appropriate to send it through my tree rather than the x86 tree.
-rw-r--r-- | arch/x86/ia32/ia32entry.S | 12 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 11 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 11 | ||||
-rw-r--r-- | include/linux/audit.h | 5 | ||||
-rw-r--r-- | kernel/auditsc.c | 6 |
5 files changed, 20 insertions, 25 deletions
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 4299eb05023c..f5bdd2881815 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -186,12 +186,12 @@ sysexit_from_sys_call: | |||
186 | 186 | ||
187 | #ifdef CONFIG_AUDITSYSCALL | 187 | #ifdef CONFIG_AUDITSYSCALL |
188 | .macro auditsys_entry_common | 188 | .macro auditsys_entry_common |
189 | movl %esi,%r9d /* 6th arg: 4th syscall arg */ | 189 | movl %esi,%r8d /* 5th arg: 4th syscall arg */ |
190 | movl %edx,%r8d /* 5th arg: 3rd syscall arg */ | 190 | movl %ecx,%r9d /*swap with edx*/ |
191 | /* (already in %ecx) 4th arg: 2nd syscall arg */ | 191 | movl %edx,%ecx /* 4th arg: 3rd syscall arg */ |
192 | movl %ebx,%edx /* 3rd arg: 1st syscall arg */ | 192 | movl %r9d,%edx /* 3rd arg: 2nd syscall arg */ |
193 | movl %eax,%esi /* 2nd arg: syscall number */ | 193 | movl %ebx,%esi /* 2nd arg: 1st syscall arg */ |
194 | movl $AUDIT_ARCH_I386,%edi /* 1st arg: audit arch */ | 194 | movl %eax,%edi /* 1st arg: syscall number */ |
195 | call __audit_syscall_entry | 195 | call __audit_syscall_entry |
196 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ | 196 | movl RAX-ARGOFFSET(%rsp),%eax /* reload syscall number */ |
197 | cmpq $(IA32_NR_syscalls-1),%rax | 197 | cmpq $(IA32_NR_syscalls-1),%rax |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 0d0c9d4ab6d5..f9e3fabc8716 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -449,12 +449,11 @@ sysenter_audit: | |||
449 | jnz syscall_trace_entry | 449 | jnz syscall_trace_entry |
450 | addl $4,%esp | 450 | addl $4,%esp |
451 | CFI_ADJUST_CFA_OFFSET -4 | 451 | CFI_ADJUST_CFA_OFFSET -4 |
452 | /* %esi already in 8(%esp) 6th arg: 4th syscall arg */ | 452 | movl %esi,4(%esp) /* 5th arg: 4th syscall arg */ |
453 | /* %edx already in 4(%esp) 5th arg: 3rd syscall arg */ | 453 | movl %edx,(%esp) /* 4th arg: 3rd syscall arg */ |
454 | /* %ecx already in 0(%esp) 4th arg: 2nd syscall arg */ | 454 | /* %ecx already in %ecx 3rd arg: 2nd syscall arg */ |
455 | movl %ebx,%ecx /* 3rd arg: 1st syscall arg */ | 455 | movl %ebx,%edx /* 2nd arg: 1st syscall arg */ |
456 | movl %eax,%edx /* 2nd arg: syscall number */ | 456 | /* %eax already in %eax 1st arg: syscall number */ |
457 | movl $AUDIT_ARCH_I386,%eax /* 1st arg: audit arch */ | ||
458 | call __audit_syscall_entry | 457 | call __audit_syscall_entry |
459 | pushl_cfi %ebx | 458 | pushl_cfi %ebx |
460 | movl PT_EAX(%esp),%eax /* reload syscall number */ | 459 | movl PT_EAX(%esp),%eax /* reload syscall number */ |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index c844f0816ab8..5e8cb2ad9fb3 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -488,12 +488,11 @@ badsys: | |||
488 | * jump back to the normal fast path. | 488 | * jump back to the normal fast path. |
489 | */ | 489 | */ |
490 | auditsys: | 490 | auditsys: |
491 | movq %r10,%r9 /* 6th arg: 4th syscall arg */ | 491 | movq %r10,%r8 /* 5th arg: 4th syscall arg */ |
492 | movq %rdx,%r8 /* 5th arg: 3rd syscall arg */ | 492 | movq %rdx,%rcx /* 4th arg: 3rd syscall arg */ |
493 | movq %rsi,%rcx /* 4th arg: 2nd syscall arg */ | 493 | movq %rsi,%rdx /* 3rd arg: 2nd syscall arg */ |
494 | movq %rdi,%rdx /* 3rd arg: 1st syscall arg */ | 494 | movq %rdi,%rsi /* 2nd arg: 1st syscall arg */ |
495 | movq %rax,%rsi /* 2nd arg: syscall number */ | 495 | movq %rax,%rdi /* 1st arg: syscall number */ |
496 | movl $AUDIT_ARCH_X86_64,%edi /* 1st arg: audit arch */ | ||
497 | call __audit_syscall_entry | 496 | call __audit_syscall_entry |
498 | LOAD_ARGS 0 /* reload call-clobbered registers */ | 497 | LOAD_ARGS 0 /* reload call-clobbered registers */ |
499 | jmp system_call_fastpath | 498 | jmp system_call_fastpath |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 783157b289e8..1ae00891aff9 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -115,8 +115,7 @@ extern void audit_log_session_info(struct audit_buffer *ab); | |||
115 | /* Public API */ | 115 | /* Public API */ |
116 | extern int audit_alloc(struct task_struct *task); | 116 | extern int audit_alloc(struct task_struct *task); |
117 | extern void __audit_free(struct task_struct *task); | 117 | extern void __audit_free(struct task_struct *task); |
118 | extern void __audit_syscall_entry(int arch, | 118 | extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1, |
119 | int major, unsigned long a0, unsigned long a1, | ||
120 | unsigned long a2, unsigned long a3); | 119 | unsigned long a2, unsigned long a3); |
121 | extern void __audit_syscall_exit(int ret_success, long ret_value); | 120 | extern void __audit_syscall_exit(int ret_success, long ret_value); |
122 | extern struct filename *__audit_reusename(const __user char *uptr); | 121 | extern struct filename *__audit_reusename(const __user char *uptr); |
@@ -148,7 +147,7 @@ static inline void audit_syscall_entry(int major, unsigned long a0, | |||
148 | unsigned long a3) | 147 | unsigned long a3) |
149 | { | 148 | { |
150 | if (unlikely(current->audit_context)) | 149 | if (unlikely(current->audit_context)) |
151 | __audit_syscall_entry(syscall_get_arch(), major, a0, a1, a2, a3); | 150 | __audit_syscall_entry(major, a0, a1, a2, a3); |
152 | } | 151 | } |
153 | static inline void audit_syscall_exit(void *pt_regs) | 152 | static inline void audit_syscall_exit(void *pt_regs) |
154 | { | 153 | { |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 9f03ac205e1f..4e17443fd1ef 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1506,7 +1506,6 @@ void __audit_free(struct task_struct *tsk) | |||
1506 | 1506 | ||
1507 | /** | 1507 | /** |
1508 | * audit_syscall_entry - fill in an audit record at syscall entry | 1508 | * audit_syscall_entry - fill in an audit record at syscall entry |
1509 | * @arch: architecture type | ||
1510 | * @major: major syscall type (function) | 1509 | * @major: major syscall type (function) |
1511 | * @a1: additional syscall register 1 | 1510 | * @a1: additional syscall register 1 |
1512 | * @a2: additional syscall register 2 | 1511 | * @a2: additional syscall register 2 |
@@ -1521,9 +1520,8 @@ void __audit_free(struct task_struct *tsk) | |||
1521 | * will only be written if another part of the kernel requests that it | 1520 | * will only be written if another part of the kernel requests that it |
1522 | * be written). | 1521 | * be written). |
1523 | */ | 1522 | */ |
1524 | void __audit_syscall_entry(int arch, int major, | 1523 | void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2, |
1525 | unsigned long a1, unsigned long a2, | 1524 | unsigned long a3, unsigned long a4) |
1526 | unsigned long a3, unsigned long a4) | ||
1527 | { | 1525 | { |
1528 | struct task_struct *tsk = current; | 1526 | struct task_struct *tsk = current; |
1529 | struct audit_context *context = tsk->audit_context; | 1527 | struct audit_context *context = tsk->audit_context; |