Skip to content

Commit 02aff8d

Browse files
committed
Merge tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit
Pull audit updates from Paul Moore: "We've got a reasonably broad set of audit patches for the v5.2 merge window, the highlights are below: - The biggest change, and the source of all the arch/* changes, is the patchset from Dmitry to help enable some of the work he is doing around PTRACE_GET_SYSCALL_INFO. To be honest, including this in the audit tree is a bit of a stretch, but it does help move audit a little further along towards proper syscall auditing for all arches, and everyone else seemed to agree that audit was a "good" spot for this to land (or maybe they just didn't want to merge it? dunno.). - We can now audit time/NTP adjustments. - We continue the work to connect associated audit records into a single event" * tag 'audit-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: (21 commits) audit: fix a memory leak bug ntp: Audit NTP parameters adjustment timekeeping: Audit clock adjustments audit: purge unnecessary list_empty calls audit: link integrity evm_write_xattrs record to syscall event syscall_get_arch: add "struct task_struct *" argument unicore32: define syscall_get_arch() Move EM_UNICORE to uapi/linux/elf-em.h nios2: define syscall_get_arch() nds32: define syscall_get_arch() Move EM_NDS32 to uapi/linux/elf-em.h m68k: define syscall_get_arch() hexagon: define syscall_get_arch() Move EM_HEXAGON to uapi/linux/elf-em.h h8300: define syscall_get_arch() c6x: define syscall_get_arch() arc: define syscall_get_arch() Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h audit: Make audit_log_cap and audit_copy_inode static audit: connect LOGIN record to its syscall record ...
2 parents f72dae2 + 70c4cf1 commit 02aff8d

File tree

43 files changed

+331
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+331
-107
lines changed

arch/alpha/include/asm/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <uapi/linux/audit.h>
66

7-
static inline int syscall_get_arch(void)
7+
static inline int syscall_get_arch(struct task_struct *task)
88
{
99
return AUDIT_ARCH_ALPHA;
1010
}

arch/arc/include/asm/elf.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@
1010
#define __ASM_ARC_ELF_H
1111

1212
#include <linux/types.h>
13+
#include <linux/elf-em.h>
1314
#include <uapi/asm/elf.h>
1415

15-
/* These ELF defines belong to uapi but libc elf.h already defines them */
16-
#define EM_ARCOMPACT 93
17-
18-
#define EM_ARCV2 195 /* ARCv2 Cores */
19-
2016
#define EM_ARC_INUSE (IS_ENABLED(CONFIG_ISA_ARCOMPACT) ? \
2117
EM_ARCOMPACT : EM_ARCV2)
2218

arch/arc/include/asm/syscall.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef _ASM_ARC_SYSCALL_H
1010
#define _ASM_ARC_SYSCALL_H 1
1111

12+
#include <uapi/linux/audit.h>
1213
#include <linux/err.h>
1314
#include <linux/sched.h>
1415
#include <asm/unistd.h>
@@ -67,4 +68,14 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
6768
}
6869
}
6970

71+
static inline int
72+
syscall_get_arch(struct task_struct *task)
73+
{
74+
return IS_ENABLED(CONFIG_ISA_ARCOMPACT)
75+
? (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
76+
? AUDIT_ARCH_ARCOMPACTBE : AUDIT_ARCH_ARCOMPACT)
77+
: (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
78+
? AUDIT_ARCH_ARCV2BE : AUDIT_ARCH_ARCV2);
79+
}
80+
7081
#endif

arch/arm/include/asm/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
7373
memcpy(&regs->ARM_r0 + 1, args, 5 * sizeof(args[0]));
7474
}
7575

76-
static inline int syscall_get_arch(void)
76+
static inline int syscall_get_arch(struct task_struct *task)
7777
{
7878
/* ARM tasks don't change audit architectures on the fly. */
7979
return AUDIT_ARCH_ARM;

arch/arm64/include/asm/syscall.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ static inline void syscall_set_arguments(struct task_struct *task,
8787
* We don't care about endianness (__AUDIT_ARCH_LE bit) here because
8888
* AArch64 has the same system calls both on little- and big- endian.
8989
*/
90-
static inline int syscall_get_arch(void)
90+
static inline int syscall_get_arch(struct task_struct *task)
9191
{
92-
if (is_compat_task())
92+
if (is_compat_thread(task_thread_info(task)))
9393
return AUDIT_ARCH_ARM;
9494

9595
return AUDIT_ARCH_AARCH64;

arch/c6x/include/asm/syscall.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef __ASM_C6X_SYSCALL_H
1212
#define __ASM_C6X_SYSCALL_H
1313

14+
#include <uapi/linux/audit.h>
1415
#include <linux/err.h>
1516
#include <linux/sched.h>
1617

@@ -69,4 +70,10 @@ static inline void syscall_set_arguments(struct task_struct *task,
6970
regs->a9 = *args;
7071
}
7172

73+
static inline int syscall_get_arch(struct task_struct *task)
74+
{
75+
return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
76+
? AUDIT_ARCH_C6XBE : AUDIT_ARCH_C6X;
77+
}
78+
7279
#endif /* __ASM_C6X_SYSCALLS_H */

arch/csky/include/asm/syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
6060
}
6161

6262
static inline int
63-
syscall_get_arch(void)
63+
syscall_get_arch(struct task_struct *task)
6464
{
6565
return AUDIT_ARCH_CSKY;
6666
}

arch/h8300/include/asm/syscall.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/linkage.h>
99
#include <linux/types.h>
1010
#include <linux/ptrace.h>
11+
#include <uapi/linux/audit.h>
1112

1213
static inline int
1314
syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
@@ -27,6 +28,11 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
2728
*args = regs->er6;
2829
}
2930

31+
static inline int
32+
syscall_get_arch(struct task_struct *task)
33+
{
34+
return AUDIT_ARCH_H8300;
35+
}
3036

3137

3238
/* Misc syscall related bits */

arch/hexagon/include/asm/elf.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323

2424
#include <asm/ptrace.h>
2525
#include <asm/user.h>
26-
27-
/*
28-
* This should really be in linux/elf-em.h.
29-
*/
30-
#define EM_HEXAGON 164 /* QUALCOMM Hexagon */
26+
#include <linux/elf-em.h>
3127

3228
struct elf32_hdr;
3329

arch/hexagon/include/asm/syscall.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#ifndef _ASM_HEXAGON_SYSCALL_H
2222
#define _ASM_HEXAGON_SYSCALL_H
2323

24+
#include <uapi/linux/audit.h>
25+
2426
typedef long (*syscall_fn)(unsigned long, unsigned long,
2527
unsigned long, unsigned long,
2628
unsigned long, unsigned long);
@@ -41,4 +43,10 @@ static inline void syscall_get_arguments(struct task_struct *task,
4143
{
4244
memcpy(args, &(&regs->r00)[0], 6 * sizeof(args[0]));
4345
}
46+
47+
static inline int syscall_get_arch(struct task_struct *task)
48+
{
49+
return AUDIT_ARCH_HEXAGON;
50+
}
51+
4452
#endif

0 commit comments

Comments
 (0)