audit: x86: drop arch from __audit_syscall_entry() interface
authorRichard Guy Briggs <rgb@redhat.com>
Tue, 4 Mar 2014 15:38:06 +0000 (10:38 -0500)
committerEric Paris <eparis@redhat.com>
Tue, 23 Sep 2014 20:21:28 +0000 (16:21 -0400)
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.

arch/x86/ia32/ia32entry.S
arch/x86/kernel/entry_32.S
arch/x86/kernel/entry_64.S
include/linux/audit.h
kernel/auditsc.c

index 4299eb05023cf812ee0f897a1a6189660167dc4e..f5bdd288181564ee90cb5e123e5442eb14da4791 100644 (file)
@@ -186,12 +186,12 @@ sysexit_from_sys_call:
 
 #ifdef CONFIG_AUDITSYSCALL
        .macro auditsys_entry_common
-       movl %esi,%r9d                  /* 6th arg: 4th syscall arg */
-       movl %edx,%r8d                  /* 5th arg: 3rd syscall arg */
-       /* (already in %ecx)               4th arg: 2nd syscall arg */
-       movl %ebx,%edx                  /* 3rd arg: 1st syscall arg */
-       movl %eax,%esi                  /* 2nd arg: syscall number */
-       movl $AUDIT_ARCH_I386,%edi      /* 1st arg: audit arch */
+       movl %esi,%r8d                  /* 5th arg: 4th syscall arg */
+       movl %ecx,%r9d                  /*swap with edx*/
+       movl %edx,%ecx                  /* 4th arg: 3rd syscall arg */
+       movl %r9d,%edx                  /* 3rd arg: 2nd syscall arg */
+       movl %ebx,%esi                  /* 2nd arg: 1st syscall arg */
+       movl %eax,%edi                  /* 1st arg: syscall number */
        call __audit_syscall_entry
        movl RAX-ARGOFFSET(%rsp),%eax   /* reload syscall number */
        cmpq $(IA32_NR_syscalls-1),%rax
index 0d0c9d4ab6d5b0d9cc1009ae03aebff22c1e8585..f9e3fabc871623ce076603c867b6ea52010b5a12 100644 (file)
@@ -449,12 +449,11 @@ sysenter_audit:
        jnz syscall_trace_entry
        addl $4,%esp
        CFI_ADJUST_CFA_OFFSET -4
-       /* %esi already in 8(%esp)         6th arg: 4th syscall arg */
-       /* %edx already in 4(%esp)         5th arg: 3rd syscall arg */
-       /* %ecx already in 0(%esp)         4th arg: 2nd syscall arg */
-       movl %ebx,%ecx                  /* 3rd arg: 1st syscall arg */
-       movl %eax,%edx                  /* 2nd arg: syscall number */
-       movl $AUDIT_ARCH_I386,%eax      /* 1st arg: audit arch */
+       movl %esi,4(%esp)               /* 5th arg: 4th syscall arg */
+       movl %edx,(%esp)                /* 4th arg: 3rd syscall arg */
+       /* %ecx already in %ecx            3rd arg: 2nd syscall arg */
+       movl %ebx,%edx                  /* 2nd arg: 1st syscall arg */
+       /* %eax already in %eax            1st arg: syscall number */
        call __audit_syscall_entry
        pushl_cfi %ebx
        movl PT_EAX(%esp),%eax          /* reload syscall number */
index c844f0816ab8b383615fe9908010be92a7380d16..5e8cb2ad9fb3f723358b1c7444484edfbfd0a9bf 100644 (file)
@@ -488,12 +488,11 @@ badsys:
         * jump back to the normal fast path.
         */
 auditsys:
-       movq %r10,%r9                   /* 6th arg: 4th syscall arg */
-       movq %rdx,%r8                   /* 5th arg: 3rd syscall arg */
-       movq %rsi,%rcx                  /* 4th arg: 2nd syscall arg */
-       movq %rdi,%rdx                  /* 3rd arg: 1st syscall arg */
-       movq %rax,%rsi                  /* 2nd arg: syscall number */
-       movl $AUDIT_ARCH_X86_64,%edi    /* 1st arg: audit arch */
+       movq %r10,%r8                   /* 5th arg: 4th syscall arg */
+       movq %rdx,%rcx                  /* 4th arg: 3rd syscall arg */
+       movq %rsi,%rdx                  /* 3rd arg: 2nd syscall arg */
+       movq %rdi,%rsi                  /* 2nd arg: 1st syscall arg */
+       movq %rax,%rdi                  /* 1st arg: syscall number */
        call __audit_syscall_entry
        LOAD_ARGS 0             /* reload call-clobbered registers */
        jmp system_call_fastpath
index 783157b289e8b114ea82b92e67cc6a5f23794259..1ae00891aff9bacb64d80d2db24da82a9acb6c93 100644 (file)
@@ -115,8 +115,7 @@ extern void audit_log_session_info(struct audit_buffer *ab);
                                /* Public API */
 extern int  audit_alloc(struct task_struct *task);
 extern void __audit_free(struct task_struct *task);
-extern void __audit_syscall_entry(int arch,
-                                 int major, unsigned long a0, unsigned long a1,
+extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1,
                                  unsigned long a2, unsigned long a3);
 extern void __audit_syscall_exit(int ret_success, long ret_value);
 extern struct filename *__audit_reusename(const __user char *uptr);
@@ -148,7 +147,7 @@ static inline void audit_syscall_entry(int major, unsigned long a0,
                                       unsigned long a3)
 {
        if (unlikely(current->audit_context))
-               __audit_syscall_entry(syscall_get_arch(), major, a0, a1, a2, a3);
+               __audit_syscall_entry(major, a0, a1, a2, a3);
 }
 static inline void audit_syscall_exit(void *pt_regs)
 {
index 9f03ac205e1f47957b678665b9506b01875c1e3d..4e17443fd1efb1f26d381fd15f0da72fbd12f154 100644 (file)
@@ -1506,7 +1506,6 @@ void __audit_free(struct task_struct *tsk)
 
 /**
  * audit_syscall_entry - fill in an audit record at syscall entry
- * @arch: architecture type
  * @major: major syscall type (function)
  * @a1: additional syscall register 1
  * @a2: additional syscall register 2
@@ -1521,9 +1520,8 @@ void __audit_free(struct task_struct *tsk)
  * will only be written if another part of the kernel requests that it
  * be written).
  */
-void __audit_syscall_entry(int arch, int major,
-                        unsigned long a1, unsigned long a2,
-                        unsigned long a3, unsigned long a4)
+void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,
+                          unsigned long a3, unsigned long a4)
 {
        struct task_struct *tsk = current;
        struct audit_context *context = tsk->audit_context;
This page took 0.030972 seconds and 5 git commands to generate.