diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2013-10-30 18:05:24 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2013-11-05 11:15:03 -0500 |
commit | 9410d228a4cf434305306746bb799fb7acdd8648 (patch) | |
tree | 93dc6f756af3c2557f2e1377bad52582fdd9fe19 /include/linux/audit.h | |
parent | d9cfea91e97d5d19f9d69beaa844f5fe56a6adc6 (diff) |
audit: call audit_bprm() only once to add AUDIT_EXECVE information
Move the audit_bprm() call from search_binary_handler() to exec_binprm(). This
allows us to get rid of the mm member of struct audit_aux_data_execve since
bprm->mm will equal current->mm.
This also mitigates the issue that ->argc could be modified by the
load_binary() call in search_binary_handler().
audit_bprm() was being called to add an AUDIT_EXECVE record to the audit
context every time search_binary_handler() was recursively called. Only one
reference is necessary.
Reported-by: Oleg Nesterov <onestero@redhat.com>
Cc: Eric Paris <eparis@redhat.com>
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
---
This patch is against 3.11, but was developed on Oleg's post-3.11 patches that
introduce exec_binprm().
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r-- | include/linux/audit.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 08b38bf13eb9..a40641954c29 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -238,11 +238,10 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid | |||
238 | if (unlikely(!audit_dummy_context())) | 238 | if (unlikely(!audit_dummy_context())) |
239 | __audit_ipc_set_perm(qbytes, uid, gid, mode); | 239 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
240 | } | 240 | } |
241 | static inline int audit_bprm(struct linux_binprm *bprm) | 241 | static inline void audit_bprm(struct linux_binprm *bprm) |
242 | { | 242 | { |
243 | if (unlikely(!audit_dummy_context())) | 243 | if (unlikely(!audit_dummy_context())) |
244 | __audit_bprm(bprm); | 244 | __audit_bprm(bprm); |
245 | return 0; | ||
246 | } | 245 | } |
247 | static inline int audit_socketcall(int nargs, unsigned long *args) | 246 | static inline int audit_socketcall(int nargs, unsigned long *args) |
248 | { | 247 | { |
@@ -369,10 +368,8 @@ static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | |||
369 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, | 368 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, |
370 | gid_t gid, umode_t mode) | 369 | gid_t gid, umode_t mode) |
371 | { } | 370 | { } |
372 | static inline int audit_bprm(struct linux_binprm *bprm) | 371 | static inline void audit_bprm(struct linux_binprm *bprm) |
373 | { | 372 | { } |
374 | return 0; | ||
375 | } | ||
376 | static inline int audit_socketcall(int nargs, unsigned long *args) | 373 | static inline int audit_socketcall(int nargs, unsigned long *args) |
377 | { | 374 | { |
378 | return 0; | 375 | return 0; |