summaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2013-04-19 15:00:33 -0400
committerEric Paris <eparis@redhat.com>2013-04-30 15:31:28 -0400
commitb122c3767c1d89763b4babca062c3171a71ed97c (patch)
tree6d11cbca5af63bd1ac4089895d8751f09af28823 /kernel/auditsc.c
parent152f497b9b5940f81de3205465840a5eb316458e (diff)
downloadop-kernel-dev-b122c3767c1d89763b4babca062c3171a71ed97c.zip
op-kernel-dev-b122c3767c1d89763b4babca062c3171a71ed97c.tar.gz
audit: use a consistent audit helper to log lsm information
We have a number of places we were reimplementing the same code to write out lsm labels. Just do it one darn place. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 4baf61d..17e9a26 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1109,7 +1109,7 @@ static inline void audit_free_context(struct audit_context *context)
kfree(context);
}
-void audit_log_task_context(struct audit_buffer *ab)
+int audit_log_task_context(struct audit_buffer *ab)
{
char *ctx = NULL;
unsigned len;
@@ -1118,22 +1118,22 @@ void audit_log_task_context(struct audit_buffer *ab)
security_task_getsecid(current, &sid);
if (!sid)
- return;
+ return 0;
error = security_secid_to_secctx(sid, &ctx, &len);
if (error) {
if (error != -EINVAL)
goto error_path;
- return;
+ return 0;
}
audit_log_format(ab, " subj=%s", ctx);
security_release_secctx(ctx, len);
- return;
+ return 0;
error_path:
audit_panic("error in audit_log_task_context");
- return;
+ return error;
}
EXPORT_SYMBOL(audit_log_task_context);
OpenPOWER on IntegriCloud