summaryrefslogtreecommitdiff
path: root/include/linux/audit.h
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-05-13 04:58:21 +0300
committerPaul Moore <paul@paul-moore.com>2018-05-15 00:45:21 +0300
commitc0b0ae8a871bc2ebbe1ff9c9871efcf88994ffec (patch)
tree6f3c9f546f71dc837d22b4c5a9167e1d7c33414e /include/linux/audit.h
parentcdfb6b341f0f2409aba24b84f3b4b2bba50be5c5 (diff)
downloadlinux-c0b0ae8a871bc2ebbe1ff9c9871efcf88994ffec.tar.xz
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 'include/linux/audit.h')
-rw-r--r--include/linux/audit.h7
1 files changed, 7 insertions, 0 deletions
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;