aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-27 16:53:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-27 16:53:16 -0400
commit4a10a91756ef381bced7b88cfb9232f660b92d93 (patch)
tree6b15cd0593332fbbc8d6e4f4b0bf2b91156880f5
parente22619a29fcdb513b7bc020e84225bb3b5914259 (diff)
parent0b08c5e59441d08ab4b5e72afefd5cd98a4d83df (diff)
Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
Pull audit updates from Paul Moore: "Four small audit patches for v4.2, all bug fixes. Only 10 lines of change this time so very unremarkable, the patch subject lines pretty much tell the whole story" * 'upstream' of git://git.infradead.org/users/pcmoore/audit: audit: Fix check of return value of strnlen_user() audit: obsolete audit_context check is removed in audit_filter_rules() audit: fix for typo in comment to function audit_log_link_denied() lsm: rename duplicate labels in LSM_AUDIT_DATA_TASK audit message type
-rw-r--r--kernel/audit.c2
-rw-r--r--kernel/auditsc.c6
-rw-r--r--security/lsm_audit.c2
3 files changed, 4 insertions, 6 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 1c13e4267de6..f9e6065346db 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1904,7 +1904,7 @@ EXPORT_SYMBOL(audit_log_task_info);
1904 1904
1905/** 1905/**
1906 * audit_log_link_denied - report a link restriction denial 1906 * audit_log_link_denied - report a link restriction denial
1907 * @operation: specific link opreation 1907 * @operation: specific link operation
1908 * @link: the path that triggered the restriction 1908 * @link: the path that triggered the restriction
1909 */ 1909 */
1910void audit_log_link_denied(const char *operation, struct path *link) 1910void audit_log_link_denied(const char *operation, struct path *link)
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 9fb9d1cb83ce..09c65640cad6 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -599,9 +599,7 @@ static int audit_filter_rules(struct task_struct *tsk,
599 result = match_tree_refs(ctx, rule->tree); 599 result = match_tree_refs(ctx, rule->tree);
600 break; 600 break;
601 case AUDIT_LOGINUID: 601 case AUDIT_LOGINUID:
602 result = 0; 602 result = audit_uid_comparator(tsk->loginuid, f->op, f->uid);
603 if (ctx)
604 result = audit_uid_comparator(tsk->loginuid, f->op, f->uid);
605 break; 603 break;
606 case AUDIT_LOGINUID_SET: 604 case AUDIT_LOGINUID_SET:
607 result = audit_comparator(audit_loginuid_set(tsk), f->op, f->val); 605 result = audit_comparator(audit_loginuid_set(tsk), f->op, f->val);
@@ -1023,7 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
1023 * for strings that are too long, we should not have created 1021 * for strings that are too long, we should not have created
1024 * any. 1022 * any.
1025 */ 1023 */
1026 if (unlikely((len == -1) || len > MAX_ARG_STRLEN - 1)) { 1024 if (unlikely((len == 0) || len > MAX_ARG_STRLEN - 1)) {
1027 WARN_ON(1); 1025 WARN_ON(1);
1028 send_sig(SIGKILL, current, 0); 1026 send_sig(SIGKILL, current, 0);
1029 return -1; 1027 return -1;
diff --git a/security/lsm_audit.c b/security/lsm_audit.c
index 1d34277dc402..4ed98107ace3 100644
--- a/security/lsm_audit.c
+++ b/security/lsm_audit.c
@@ -282,7 +282,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
282 pid_t pid = task_pid_nr(tsk); 282 pid_t pid = task_pid_nr(tsk);
283 if (pid) { 283 if (pid) {
284 char comm[sizeof(tsk->comm)]; 284 char comm[sizeof(tsk->comm)];
285 audit_log_format(ab, " pid=%d comm=", pid); 285 audit_log_format(ab, " opid=%d ocomm=", pid);
286 audit_log_untrustedstring(ab, 286 audit_log_untrustedstring(ab,
287 memcpy(comm, tsk->comm, sizeof(comm))); 287 memcpy(comm, tsk->comm, sizeof(comm)));
288 } 288 }