diff options
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index c1ab8dbbb67b..09a37581213b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -429,25 +429,21 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
429 | break; | 429 | break; |
430 | case AUDIT_USER: | 430 | case AUDIT_USER: |
431 | case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG: | 431 | case AUDIT_FIRST_USER_MSG...AUDIT_LAST_USER_MSG: |
432 | read_lock(&tasklist_lock); | 432 | if (!audit_enabled && msg_type != AUDIT_USER_AVC) |
433 | tsk = find_task_by_pid(pid); | 433 | return 0; |
434 | if (tsk) | 434 | |
435 | get_task_struct(tsk); | 435 | err = audit_filter_user(pid, msg_type); |
436 | read_unlock(&tasklist_lock); | 436 | if (err == 1) { |
437 | if (!tsk) | 437 | err = 0; |
438 | return -ESRCH; | 438 | ab = audit_log_start(NULL, msg_type); |
439 | 439 | if (ab) { | |
440 | if (audit_enabled && audit_filter_user(tsk, msg_type)) { | 440 | audit_log_format(ab, |
441 | ab = audit_log_start(NULL, msg_type); | 441 | "user pid=%d uid=%u auid=%u msg='%.1024s'", |
442 | if (ab) { | 442 | pid, uid, loginuid, (char *)data); |
443 | audit_log_format(ab, | 443 | audit_set_pid(ab, pid); |
444 | "user pid=%d uid=%u auid=%u msg='%.1024s'", | 444 | audit_log_end(ab); |
445 | pid, uid, loginuid, (char *)data); | 445 | } |
446 | audit_set_pid(ab, pid); | ||
447 | audit_log_end(ab); | ||
448 | } | ||
449 | } | 446 | } |
450 | put_task_struct(tsk); | ||
451 | break; | 447 | break; |
452 | case AUDIT_ADD: | 448 | case AUDIT_ADD: |
453 | case AUDIT_DEL: | 449 | case AUDIT_DEL: |