Skip to content

Commit

Permalink
Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Jun 27, 2015
2 parents e22619a + 0b08c5e commit 4a10a91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,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)
Expand Down
6 changes: 2 additions & 4 deletions kernel/auditsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1023,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;
Expand Down
2 changes: 1 addition & 1 deletion security/lsm_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
pid_t pid = task_pid_nr(tsk);
if (pid) {
char comm[sizeof(tsk->comm)];
audit_log_format(ab, " pid=%d comm=", pid);
audit_log_format(ab, " opid=%d ocomm=", pid);
audit_log_untrustedstring(ab,
memcpy(comm, tsk->comm, sizeof(comm)));
}
Expand Down

0 comments on commit 4a10a91

Please sign in to comment.