Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Move audit_arch() helper function to __syscall_get_arch().

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+17 -13
+14
arch/mips/include/asm/syscall.h
··· 13 13 #ifndef __ASM_MIPS_SYSCALL_H 14 14 #define __ASM_MIPS_SYSCALL_H 15 15 16 + #include <linux/audit.h> 17 + #include <linux/elf-em.h> 16 18 #include <linux/kernel.h> 17 19 #include <linux/sched.h> 18 20 #include <linux/uaccess.h> ··· 81 79 extern const unsigned long sys_call_table[]; 82 80 extern const unsigned long sys32_call_table[]; 83 81 extern const unsigned long sysn32_call_table[]; 82 + 83 + static inline int __syscall_get_arch(void) 84 + { 85 + int arch = EM_MIPS; 86 + #ifdef CONFIG_64BIT 87 + arch |= __AUDIT_ARCH_64BIT; 88 + #endif 89 + #if defined(__LITTLE_ENDIAN) 90 + arch |= __AUDIT_ARCH_LE; 91 + #endif 92 + return arch; 93 + } 84 94 85 95 #endif /* __ASM_MIPS_SYSCALL_H */
+3 -13
arch/mips/kernel/ptrace.c
··· 38 38 #include <asm/mipsmtregs.h> 39 39 #include <asm/pgtable.h> 40 40 #include <asm/page.h> 41 + #include <asm/syscall.h> 41 42 #include <asm/uaccess.h> 42 43 #include <asm/bootinfo.h> 43 44 #include <asm/reg.h> ··· 648 647 return ret; 649 648 } 650 649 651 - static inline int audit_arch(void) 652 - { 653 - int arch = EM_MIPS; 654 - #ifdef CONFIG_64BIT 655 - arch |= __AUDIT_ARCH_64BIT; 656 - #endif 657 - #if defined(__LITTLE_ENDIAN) 658 - arch |= __AUDIT_ARCH_LE; 659 - #endif 660 - return arch; 661 - } 662 - 663 650 /* 664 651 * Notification of system call entry/exit 665 652 * - triggered by current->work.syscall_trace ··· 662 673 if (test_thread_flag(TIF_SYSCALL_TRACE)) 663 674 ptrace_report_syscall(regs); 664 675 665 - audit_syscall_entry(audit_arch(), regs->regs[2], 676 + audit_syscall_entry(__syscall_get_arch(), 677 + regs->regs[2], 666 678 regs->regs[4], regs->regs[5], 667 679 regs->regs[6], regs->regs[7]); 668 680 }