diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2013-12-11 13:52:26 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-03-20 10:11:55 -0400 |
commit | f1dc4867ff41b7bcca57fa19449d1fe7ad517ac1 (patch) | |
tree | 873f8e7625dc54ae20a0cc2513fb6a33027f36d7 /drivers/tty | |
parent | c92cdeb45eea38515e82187f48c2e4f435fb4e25 (diff) |
audit: anchor all pid references in the initial pid namespace
Store and log all PIDs with reference to the initial PID namespace and
use the access functions task_pid_nr() and task_tgid_nr() for task->pid
and task->tgid.
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
(informed by ebiederman's c776b5d2)
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/tty_audit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index b0e540137e3..90ca082935f 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -65,6 +65,7 @@ static void tty_audit_log(const char *description, int major, int minor, { struct audit_buffer *ab; struct task_struct *tsk = current; + pid_t pid = task_pid_nr(tsk); uid_t uid = from_kuid(&init_user_ns, task_uid(tsk)); uid_t loginuid = from_kuid(&init_user_ns, audit_get_loginuid(tsk)); unsigned int sessionid = audit_get_sessionid(tsk); @@ -74,7 +75,7 @@ static void tty_audit_log(const char *description, int major, int minor, char name[sizeof(tsk->comm)]; audit_log_format(ab, "%s pid=%u uid=%u auid=%u ses=%u major=%d" - " minor=%d comm=", description, tsk->pid, uid, + " minor=%d comm=", description, pid, uid, loginuid, sessionid, major, minor); get_task_comm(name, tsk); audit_log_untrustedstring(ab, name); |