From c0b0ae8a871bc2ebbe1ff9c9871efcf88994ffec Mon Sep 17 00:00:00 2001 From: Richard Guy Briggs Date: Sat, 12 May 2018 21:58:21 -0400 Subject: 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 [PM: merge fuzz in audit.h] Signed-off-by: Paul Moore --- include/linux/audit.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/audit.h') diff --git a/include/linux/audit.h b/include/linux/audit.h index 831a4684df40..69c78477590b 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -237,6 +237,11 @@ extern void audit_seccomp_actions_logged(const char *names, const char *old_names, int res); extern void __audit_ptrace(struct task_struct *t); +static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx) +{ + task->audit_context = ctx; +} + static inline struct audit_context *audit_context(void) { return current->audit_context; @@ -469,6 +474,8 @@ static inline bool audit_dummy_context(void) { return true; } +static inline void audit_set_context(struct task_struct *task, struct audit_context *ctx) +{ } static inline struct audit_context *audit_context(void) { return NULL; -- cgit v1.2.3