diff options
| author | Paul Moore <paul@paul-moore.com> | 2016-08-30 17:19:13 -0400 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-12-28 23:59:55 +0100 |
| commit | afbb356a4005006f56fd56e16b89527334c64294 (patch) | |
| tree | 6dda41c7d9825bad07cae6cac766a962128dc345 /security | |
| parent | 6881475d3410ba34a8fecf9fbc43bdc8caa23b55 (diff) | |
BACKPORT: audit: consistently record PIDs with task_tgid_nr()
Unfortunately we record PIDs in audit records using a variety of
methods despite the correct way being the use of task_tgid_nr().
This patch converts all of these callers, except for the case of
AUDIT_SET in audit_receive_msg() (see the comment in the code).
Reported-by: Jeff Vander Stoep <jeffv@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Bug: 28952093
(cherry picked from commit fa2bea2f5cca5b8d4a3e5520d2e8c0ede67ac108)
Signed-off-by: Jeff Vander Stoep <jeffv@google.com>
Change-Id: I36508a25c957f5108299e68a3b0f627c94eb27eb
Signed-off-by: Joe Maples <joe@frap129.org>
Diffstat (limited to 'security')
| -rw-r--r-- | security/lsm_audit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/lsm_audit.c b/security/lsm_audit.c index fe7d8636c..4f021ad69 100644 --- a/security/lsm_audit.c +++ b/security/lsm_audit.c @@ -222,7 +222,7 @@ static void dump_common_audit_data(struct audit_buffer *ab, if (tsk->cred) audit_log_format(ab, " uid=%d", tsk->cred->uid); - audit_log_format(ab, " pid=%d comm=", tsk->pid); + audit_log_format(ab, " pid=%d comm=", task_tgid_nr(current)); audit_log_untrustedstring(ab, tsk->comm); switch (a->type) { @@ -298,7 +298,7 @@ static void dump_common_audit_data(struct audit_buffer *ab, if (tsk && tsk->pid) { if (tsk->cred) audit_log_format(ab, " uid=%d", tsk->cred->uid); - audit_log_format(ab, " pid=%d comm=", tsk->pid); + audit_log_format(ab, " pid=%d comm=", task_tgid_nr(tsk)); audit_log_untrustedstring(ab, tsk->comm); } break; |
