summaryrefslogtreecommitdiff
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-05-12 21:58:21 -0400
committerPaul Moore <paul@paul-moore.com>2018-05-14 17:45:21 -0400
commitc0b0ae8a871bc2ebbe1ff9c9871efcf88994ffec (patch)
tree6f3c9f546f71dc837d22b4c5a9167e1d7c33414e /kernel/auditsc.c
parentcdfb6b341f0f2409aba24b84f3b4b2bba50be5c5 (diff)
downloadlwn-c0b0ae8a871bc2ebbe1ff9c9871efcf88994ffec.tar.gz
lwn-c0b0ae8a871bc2ebbe1ff9c9871efcf88994ffec.zip
audit: use inline function to set audit context
Recognizing that the audit context is an internal audit value, use an access function to set the audit context pointer for the task rather than reaching directly into the task struct to set it. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [PM: merge fuzz in audit.h] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index fce4acba576d..cbab0da86d15 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -865,7 +865,7 @@ static inline struct audit_context *audit_take_context(struct task_struct *tsk,
audit_filter_inodes(tsk, context);
}
- tsk->audit_context = NULL;
+ audit_set_context(tsk, NULL);
return context;
}
@@ -952,7 +952,7 @@ int audit_alloc(struct task_struct *tsk)
}
context->filterkey = key;
- tsk->audit_context = context;
+ audit_set_context(tsk, context);
set_tsk_thread_flag(tsk, TIF_SYSCALL_AUDIT);
return 0;
}
@@ -1554,7 +1554,6 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,
*/
void __audit_syscall_exit(int success, long return_code)
{
- struct task_struct *tsk = current;
struct audit_context *context;
if (success)
@@ -1589,7 +1588,7 @@ void __audit_syscall_exit(int success, long return_code)
kfree(context->filterkey);
context->filterkey = NULL;
}
- tsk->audit_context = context;
+ audit_set_context(current, context);
}
static inline void handle_one(const struct inode *inode)