Skip to content

Commit 0b74717

Browse files
committed
Merge git://git.infradead.org/users/eparis/audit
Pull audit updates from Eric Paris. * git://git.infradead.org/users/eparis/audit: (28 commits) AUDIT: make audit_is_compat depend on CONFIG_AUDIT_COMPAT_GENERIC audit: renumber AUDIT_FEATURE_CHANGE into the 1300 range audit: do not cast audit_rule_data pointers pointlesly AUDIT: Allow login in non-init namespaces audit: define audit_is_compat in kernel internal header kernel: Use RCU_INIT_POINTER(x, NULL) in audit.c sched: declare pid_alive as inline audit: use uapi/linux/audit.h for AUDIT_ARCH declarations syscall_get_arch: remove useless function arguments audit: remove stray newline from audit_log_execve_info() audit_panic() call audit: remove stray newlines from audit_log_lost messages audit: include subject in login records audit: remove superfluous new- prefix in AUDIT_LOGIN messages audit: allow user processes to log from another PID namespace audit: anchor all pid references in the initial pid namespace audit: convert PPIDs to the inital PID namespace. pid: get pid_t ppid of task in init_pid_ns audit: rename the misleading audit_get_context() to audit_take_context() audit: Add generic compat syscall support audit: Add CONFIG_HAVE_ARCH_AUDITSYSCALL ...
2 parents b7e70ca + 312103d commit 0b74717

36 files changed

Lines changed: 351 additions & 119 deletions

File tree

‎arch/alpha/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ config ALPHA
2222
select GENERIC_SMP_IDLE_THREAD
2323
select GENERIC_STRNCPY_FROM_USER
2424
select GENERIC_STRNLEN_USER
25+
select HAVE_ARCH_AUDITSYSCALL
2526
select HAVE_MOD_ARCH_SPECIFIC
2627
select MODULES_USE_ELF_RELA
2728
select ODD_RT_SIGACTION

‎arch/arm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ config ARM
2424
select GENERIC_STRNCPY_FROM_USER
2525
select GENERIC_STRNLEN_USER
2626
select HARDIRQS_SW_RESEND
27+
select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
2728
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
2829
select HAVE_ARCH_KGDB
2930
select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)

‎arch/arm/include/asm/syscall.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef _ASM_ARM_SYSCALL_H
88
#define _ASM_ARM_SYSCALL_H
99

10-
#include <linux/audit.h> /* for AUDIT_ARCH_* */
10+
#include <uapi/linux/audit.h> /* for AUDIT_ARCH_* */
1111
#include <linux/elf.h> /* for ELF_EM */
1212
#include <linux/err.h>
1313
#include <linux/sched.h>
@@ -103,8 +103,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
103103
memcpy(&regs->ARM_r0 + i, args, n * sizeof(args[0]));
104104
}
105105

106-
static inline int syscall_get_arch(struct task_struct *task,
107-
struct pt_regs *regs)
106+
static inline int syscall_get_arch(void)
108107
{
109108
/* ARM tasks don't change audit architectures on the fly. */
110109
return AUDIT_ARCH_ARM;

‎arch/ia64/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ config IA64
4545
select HAVE_MOD_ARCH_SPECIFIC
4646
select MODULES_USE_ELF_RELA
4747
select ARCH_USE_CMPXCHG_LOCKREF
48+
select HAVE_ARCH_AUDITSYSCALL
4849
default y
4950
help
5051
The Itanium Processor Family is Intel's 64-bit successor to

‎arch/mips/include/asm/syscall.h‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define __ASM_MIPS_SYSCALL_H
1515

1616
#include <linux/compiler.h>
17-
#include <linux/audit.h>
17+
#include <uapi/linux/audit.h>
1818
#include <linux/elf-em.h>
1919
#include <linux/kernel.h>
2020
#include <linux/sched.h>
@@ -127,12 +127,11 @@ extern const unsigned long sys_call_table[];
127127
extern const unsigned long sys32_call_table[];
128128
extern const unsigned long sysn32_call_table[];
129129

130-
static inline int syscall_get_arch(struct task_struct *task,
131-
struct pt_regs *regs)
130+
static inline int syscall_get_arch(void)
132131
{
133132
int arch = EM_MIPS;
134133
#ifdef CONFIG_64BIT
135-
if (!test_tsk_thread_flag(task, TIF_32BIT_REGS))
134+
if (!test_thread_flag(TIF_32BIT_REGS))
136135
arch |= __AUDIT_ARCH_64BIT;
137136
#endif
138137
#if defined(__LITTLE_ENDIAN)

‎arch/mips/kernel/ptrace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
649649
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
650650
trace_sys_enter(regs, regs->regs[2]);
651651

652-
audit_syscall_entry(syscall_get_arch(current, regs),
652+
audit_syscall_entry(syscall_get_arch(),
653653
syscall,
654654
regs->regs[4], regs->regs[5],
655655
regs->regs[6], regs->regs[7]);

‎arch/parisc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config PARISC
2828
select CLONE_BACKWARDS
2929
select TTY # Needed for pdc_cons.c
3030
select HAVE_DEBUG_STACKOVERFLOW
31+
select HAVE_ARCH_AUDITSYSCALL
3132

3233
help
3334
The PA-RISC microprocessor is designed by Hewlett-Packard and used

‎arch/powerpc/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ config PPC
144144
select HAVE_DEBUG_STACKOVERFLOW
145145
select HAVE_IRQ_EXIT_ON_IRQ_STACK
146146
select ARCH_USE_CMPXCHG_LOCKREF if PPC64
147+
select HAVE_ARCH_AUDITSYSCALL
147148

148149
config GENERIC_CSUM
149150
def_bool CPU_LITTLE_ENDIAN

‎arch/s390/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ config S390
103103
select GENERIC_SMP_IDLE_THREAD
104104
select GENERIC_TIME_VSYSCALL
105105
select HAVE_ALIGNED_STRUCT_PAGE if SLUB
106+
select HAVE_ARCH_AUDITSYSCALL
106107
select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
107108
select HAVE_ARCH_SECCOMP_FILTER
108109
select HAVE_ARCH_TRACEHOOK

‎arch/s390/include/asm/syscall.h‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#ifndef _ASM_SYSCALL_H
1313
#define _ASM_SYSCALL_H 1
1414

15-
#include <linux/audit.h>
15+
#include <uapi/linux/audit.h>
1616
#include <linux/sched.h>
1717
#include <linux/err.h>
1818
#include <asm/ptrace.h>
@@ -89,11 +89,10 @@ static inline void syscall_set_arguments(struct task_struct *task,
8989
regs->orig_gpr2 = args[0];
9090
}
9191

92-
static inline int syscall_get_arch(struct task_struct *task,
93-
struct pt_regs *regs)
92+
static inline int syscall_get_arch(void)
9493
{
9594
#ifdef CONFIG_COMPAT
96-
if (test_tsk_thread_flag(task, TIF_31BIT))
95+
if (test_tsk_thread_flag(current, TIF_31BIT))
9796
return AUDIT_ARCH_S390;
9897
#endif
9998
return sizeof(long) == 8 ? AUDIT_ARCH_S390X : AUDIT_ARCH_S390;

0 commit comments

Comments
 (0)