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>
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 831a468..69c7847 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -237,6 +237,11 @@
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 @@
{
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;