aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-19 19:25:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-19 19:25:56 -0400
commitab074ade9c33b3585da86d62e87bcb3e897a3f54 (patch)
tree142b42182889c64813af997b8701707a3397e834 /include/linux
parent61ed53deb1c6a4386d8710dbbfcee8779c381931 (diff)
parent2991dd2b0117e864f394c826af6df144206ce0db (diff)
Merge git://git.infradead.org/users/eparis/audit
Pull audit updates from Eric Paris: "So this change across a whole bunch of arches really solves one basic problem. We want to audit when seccomp is killing a process. seccomp hooks in before the audit syscall entry code. audit_syscall_entry took as an argument the arch of the given syscall. Since the arch is part of what makes a syscall number meaningful it's an important part of the record, but it isn't available when seccomp shoots the syscall... For most arch's we have a better way to get the arch (syscall_get_arch) So the solution was two fold: Implement syscall_get_arch() everywhere there is audit which didn't have it. Use syscall_get_arch() in the seccomp audit code. Having syscall_get_arch() everywhere meant it was a useless flag on the stack and we could get rid of it for the typical syscall entry. The other changes inside the audit system aren't grand, fixed some records that had invalid spaces. Better locking around the task comm field. Removing some dead functions and structs. Make some things static. Really minor stuff" * git://git.infradead.org/users/eparis/audit: (31 commits) audit: rename audit_log_remove_rule to disambiguate for trees audit: cull redundancy in audit_rule_change audit: WARN if audit_rule_change called illegally audit: put rule existence check in canonical order next: openrisc: Fix build audit: get comm using lock to avoid race in string printing audit: remove open_arg() function that is never used audit: correct AUDIT_GET_FEATURE return message type audit: set nlmsg_len for multicast messages. audit: use union for audit_field values since they are mutually exclusive audit: invalid op= values for rules audit: use atomic_t to simplify audit_serial() kernel/audit.c: use ARRAY_SIZE instead of sizeof/sizeof[0] audit: reduce scope of audit_log_fcaps audit: reduce scope of audit_net_id audit: arm64: Remove the audit arch argument to audit_syscall_entry arm64: audit: Add audit hook in syscall_trace_enter/exit() audit: x86: drop arch from __audit_syscall_entry() interface sparc: implement is_32bit_task sparc: properly conditionalize use of TIF_32BIT ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/audit.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 22cfddb75566..36dffeccebdb 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -66,12 +66,16 @@ struct audit_krule {
66 66
67struct audit_field { 67struct audit_field {
68 u32 type; 68 u32 type;
69 u32 val; 69 union {
70 kuid_t uid; 70 u32 val;
71 kgid_t gid; 71 kuid_t uid;
72 kgid_t gid;
73 struct {
74 char *lsm_str;
75 void *lsm_rule;
76 };
77 };
72 u32 op; 78 u32 op;
73 char *lsm_str;
74 void *lsm_rule;
75}; 79};
76 80
77extern int is_audit_feature_set(int which); 81extern int is_audit_feature_set(int which);
@@ -109,12 +113,13 @@ extern void audit_log_session_info(struct audit_buffer *ab);
109#endif 113#endif
110 114
111#ifdef CONFIG_AUDITSYSCALL 115#ifdef CONFIG_AUDITSYSCALL
116#include <asm/syscall.h> /* for syscall_get_arch() */
117
112/* These are defined in auditsc.c */ 118/* These are defined in auditsc.c */
113 /* Public API */ 119 /* Public API */
114extern int audit_alloc(struct task_struct *task); 120extern int audit_alloc(struct task_struct *task);
115extern void __audit_free(struct task_struct *task); 121extern void __audit_free(struct task_struct *task);
116extern void __audit_syscall_entry(int arch, 122extern void __audit_syscall_entry(int major, unsigned long a0, unsigned long a1,
117 int major, unsigned long a0, unsigned long a1,
118 unsigned long a2, unsigned long a3); 123 unsigned long a2, unsigned long a3);
119extern void __audit_syscall_exit(int ret_success, long ret_value); 124extern void __audit_syscall_exit(int ret_success, long ret_value);
120extern struct filename *__audit_reusename(const __user char *uptr); 125extern struct filename *__audit_reusename(const __user char *uptr);
@@ -141,12 +146,12 @@ static inline void audit_free(struct task_struct *task)
141 if (unlikely(task->audit_context)) 146 if (unlikely(task->audit_context))
142 __audit_free(task); 147 __audit_free(task);
143} 148}
144static inline void audit_syscall_entry(int arch, int major, unsigned long a0, 149static inline void audit_syscall_entry(int major, unsigned long a0,
145 unsigned long a1, unsigned long a2, 150 unsigned long a1, unsigned long a2,
146 unsigned long a3) 151 unsigned long a3)
147{ 152{
148 if (unlikely(current->audit_context)) 153 if (unlikely(current->audit_context))
149 __audit_syscall_entry(arch, major, a0, a1, a2, a3); 154 __audit_syscall_entry(major, a0, a1, a2, a3);
150} 155}
151static inline void audit_syscall_exit(void *pt_regs) 156static inline void audit_syscall_exit(void *pt_regs)
152{ 157{
@@ -322,7 +327,7 @@ static inline int audit_alloc(struct task_struct *task)
322} 327}
323static inline void audit_free(struct task_struct *task) 328static inline void audit_free(struct task_struct *task)
324{ } 329{ }
325static inline void audit_syscall_entry(int arch, int major, unsigned long a0, 330static inline void audit_syscall_entry(int major, unsigned long a0,
326 unsigned long a1, unsigned long a2, 331 unsigned long a1, unsigned long a2,
327 unsigned long a3) 332 unsigned long a3)
328{ } 333{ }