userns: Teach trace to use from_kuid
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 13 Mar 2012 23:02:19 +0000 (16:02 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 18 Sep 2012 08:01:34 +0000 (01:01 -0700)
- When tracing capture the kuid.
- When displaying the data to user space convert the kuid into the
  user namespace of the process that opened the report file.

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
init/Kconfig
kernel/trace/trace.c
kernel/trace/trace.h

index 6de46ef12e3f57aeb573851a0c62d0b5f1123d36..2a388e569a28c5eb584bff1b3c9545c8c22cc736 100644 (file)
@@ -927,7 +927,6 @@ config UIDGID_CONVERTED
        # Features
        depends on IMA = n
        depends on EVM = n
-       depends on TRACING = n
        depends on FS_POSIX_ACL = n
        depends on QUOTA = n
        depends on QUOTACTL = n
index 5c38c81496ceb7d3b6b1e1aa457a2cf0c5752c52..c9ace838d5095c34c8b93cbd168cc5a556bfdf25 100644 (file)
@@ -2060,7 +2060,8 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter)
        seq_puts(m, "#    -----------------\n");
        seq_printf(m, "#    | task: %.16s-%d "
                   "(uid:%d nice:%ld policy:%ld rt_prio:%ld)\n",
-                  data->comm, data->pid, data->uid, data->nice,
+                  data->comm, data->pid,
+                  from_kuid_munged(seq_user_ns(m), data->uid), data->nice,
                   data->policy, data->rt_priority);
        seq_puts(m, "#    -----------------\n");
 
index 55e1f7f0db126edf4bbcbe07245a9558b1030bec..40a6f30c985f2faa4321c8afc08c05ee286283de 100644 (file)
@@ -147,7 +147,7 @@ struct trace_array_cpu {
        unsigned long           skipped_entries;
        cycle_t                 preempt_timestamp;
        pid_t                   pid;
-       uid_t                   uid;
+       kuid_t                  uid;
        char                    comm[TASK_COMM_LEN];
 };