aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-05-12 21:58:20 -0400
committerPaul Moore <paul@paul-moore.com>2018-05-14 17:24:18 -0400
commitcdfb6b341f0f2409aba24b84f3b4b2bba50be5c5 (patch)
treecb31684487723bae90c53e58d97b7b9e6aa53020 /security/selinux/hooks.c
parentf0b752168d7091f38e7d61a80de2542e8b71d266 (diff)
audit: use inline function to get audit context
Recognizing that the audit context is an internal audit value, use an access function to retrieve the audit context pointer for the task rather than reaching directly into the task struct to get it. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [PM: merge fuzz in auditsc.c and selinuxfs.c, checkpatch.pl fixes] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 4cafe6a19167..713c1648014f 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3294,7 +3294,8 @@ static int selinux_inode_setxattr(struct dentry *dentry, const char *name,
3294 } else { 3294 } else {
3295 audit_size = 0; 3295 audit_size = 0;
3296 } 3296 }
3297 ab = audit_log_start(current->audit_context, GFP_ATOMIC, AUDIT_SELINUX_ERR); 3297 ab = audit_log_start(audit_context(),
3298 GFP_ATOMIC, AUDIT_SELINUX_ERR);
3298 audit_log_format(ab, "op=setxattr invalid_context="); 3299 audit_log_format(ab, "op=setxattr invalid_context=");
3299 audit_log_n_untrustedstring(ab, value, audit_size); 3300 audit_log_n_untrustedstring(ab, value, audit_size);
3300 audit_log_end(ab); 3301 audit_log_end(ab);
@@ -6431,7 +6432,9 @@ static int selinux_setprocattr(const char *name, void *value, size_t size)
6431 audit_size = size - 1; 6432 audit_size = size - 1;
6432 else 6433 else
6433 audit_size = size; 6434 audit_size = size;
6434 ab = audit_log_start(current->audit_context, GFP_ATOMIC, AUDIT_SELINUX_ERR); 6435 ab = audit_log_start(audit_context(),
6436 GFP_ATOMIC,
6437 AUDIT_SELINUX_ERR);
6435 audit_log_format(ab, "op=fscreate invalid_context="); 6438 audit_log_format(ab, "op=fscreate invalid_context=");
6436 audit_log_n_untrustedstring(ab, value, audit_size); 6439 audit_log_n_untrustedstring(ab, value, audit_size);
6437 audit_log_end(ab); 6440 audit_log_end(ab);