diff options
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index e9bcb93800d8..3d2853808185 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -70,6 +70,11 @@ | |||
70 | 70 | ||
71 | #include "audit.h" | 71 | #include "audit.h" |
72 | 72 | ||
73 | /* flags stating the success for a syscall */ | ||
74 | #define AUDITSC_INVALID 0 | ||
75 | #define AUDITSC_SUCCESS 1 | ||
76 | #define AUDITSC_FAILURE 2 | ||
77 | |||
73 | /* AUDIT_NAMES is the number of slots we reserve in the audit_context | 78 | /* AUDIT_NAMES is the number of slots we reserve in the audit_context |
74 | * for saving names from getname(). If we get more names we will allocate | 79 | * for saving names from getname(). If we get more names we will allocate |
75 | * a name dynamically and also add those to the list anchored by names_list. */ | 80 | * a name dynamically and also add those to the list anchored by names_list. */ |
@@ -1724,8 +1729,7 @@ void audit_finish_fork(struct task_struct *child) | |||
1724 | 1729 | ||
1725 | /** | 1730 | /** |
1726 | * audit_syscall_exit - deallocate audit context after a system call | 1731 | * audit_syscall_exit - deallocate audit context after a system call |
1727 | * @valid: success/failure flag | 1732 | * @pt_regs: syscall registers |
1728 | * @return_code: syscall return value | ||
1729 | * | 1733 | * |
1730 | * Tear down after system call. If the audit context has been marked as | 1734 | * Tear down after system call. If the audit context has been marked as |
1731 | * auditable (either because of the AUDIT_RECORD_CONTEXT state from | 1735 | * auditable (either because of the AUDIT_RECORD_CONTEXT state from |
@@ -1733,13 +1737,17 @@ void audit_finish_fork(struct task_struct *child) | |||
1733 | * message), then write out the syscall information. In call cases, | 1737 | * message), then write out the syscall information. In call cases, |
1734 | * free the names stored from getname(). | 1738 | * free the names stored from getname(). |
1735 | */ | 1739 | */ |
1736 | void audit_syscall_exit(int valid, long return_code) | 1740 | void __audit_syscall_exit(int success, long return_code) |
1737 | { | 1741 | { |
1738 | struct task_struct *tsk = current; | 1742 | struct task_struct *tsk = current; |
1739 | struct audit_context *context; | 1743 | struct audit_context *context; |
1740 | 1744 | ||
1741 | context = audit_get_context(tsk, valid, return_code); | 1745 | if (success) |
1746 | success = AUDITSC_SUCCESS; | ||
1747 | else | ||
1748 | success = AUDITSC_FAILURE; | ||
1742 | 1749 | ||
1750 | context = audit_get_context(tsk, success, return_code); | ||
1743 | if (likely(!context)) | 1751 | if (likely(!context)) |
1744 | return; | 1752 | return; |
1745 | 1753 | ||