From 5c5bc97e2fc819112ece40e7d433039d6df8f7ba Mon Sep 17 00:00:00 2001 From: Richard Guy Briggs Date: Wed, 15 Apr 2015 14:08:25 -0400 Subject: lsm: rename duplicate labels in LSM_AUDIT_DATA_TASK audit message type The LSM_AUDIT_DATA_TASK pid= and comm= labels are duplicates of those at the start of this function with different values. Rename them to their object counterparts opid= and ocomm= to disambiguate. Signed-off-by: Richard Guy Briggs [PM: minor merging needed due to differences in the tree] Signed-off-by: Paul Moore --- security/lsm_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/lsm_audit.c b/security/lsm_audit.c index 69fdf3bc765b..07fc99724d41 100644 --- a/security/lsm_audit.c +++ b/security/lsm_audit.c @@ -281,7 +281,7 @@ static void dump_common_audit_data(struct audit_buffer *ab, if (tsk) { pid_t pid = task_pid_nr(tsk); if (pid) { - audit_log_format(ab, " pid=%d comm=", pid); + audit_log_format(ab, " opid=%d ocomm=", pid); audit_log_untrustedstring(ab, tsk->comm); } } -- cgit v1.2.3-59-g8ed1b From 2201196479748b84e5526b2f81112fe2d0aaa37a Mon Sep 17 00:00:00 2001 From: Shailendra Verma Date: Sat, 23 May 2015 10:40:27 +0530 Subject: audit: fix for typo in comment to function audit_log_link_denied() Signed-off-by: Shailendra Verma [PM: tweaked subject line] Signed-off-by: Paul Moore --- kernel/audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit.c b/kernel/audit.c index 72ab759a0b43..7497a5a0fac0 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1891,7 +1891,7 @@ EXPORT_SYMBOL(audit_log_task_info); /** * audit_log_link_denied - report a link restriction denial - * @operation: specific link opreation + * @operation: specific link operation * @link: the path that triggered the restriction */ void audit_log_link_denied(const char *operation, struct path *link) -- cgit v1.2.3-59-g8ed1b From 5c1390c9ffdaeb9f7e544cea3a1699a341cad1fb Mon Sep 17 00:00:00 2001 From: Mikhail Klementyev Date: Mon, 25 May 2015 23:20:38 +0300 Subject: audit: obsolete audit_context check is removed in audit_filter_rules() Signed-off-by: Mikhail Klementyev [PM: patch applied by hand due to HTML mangling, rewrote subject line] Signed-off-by: Paul Moore --- kernel/auditsc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index dc4ae70a7413..d81424fbec3a 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -599,9 +599,7 @@ static int audit_filter_rules(struct task_struct *tsk, result = match_tree_refs(ctx, rule->tree); break; case AUDIT_LOGINUID: - result = 0; - if (ctx) - result = audit_uid_comparator(tsk->loginuid, f->op, f->uid); + result = audit_uid_comparator(tsk->loginuid, f->op, f->uid); break; case AUDIT_LOGINUID_SET: result = audit_comparator(audit_loginuid_set(tsk), f->op, f->val); -- cgit v1.2.3-59-g8ed1b From 0b08c5e59441d08ab4b5e72afefd5cd98a4d83df Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 2 Jun 2015 17:08:29 +0200 Subject: audit: Fix check of return value of strnlen_user() strnlen_user() returns 0 when it hits fault, not -1. Fix the test in audit_log_single_execve_arg(). Luckily this shouldn't ever happen unless there's a kernel bug so it's mostly a cosmetic fix. CC: Paul Moore Signed-off-by: Jan Kara Signed-off-by: Paul Moore --- kernel/auditsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index d81424fbec3a..f6bc31e7dca9 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1021,7 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context, * for strings that are too long, we should not have created * any. */ - if (unlikely((len == -1) || len > MAX_ARG_STRLEN - 1)) { + if (unlikely((len == 0) || len > MAX_ARG_STRLEN - 1)) { WARN_ON(1); send_sig(SIGKILL, current, 0); return -1; -- cgit v1.2.3-59-g8ed1b