aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-01-11 10:28:19 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-11 10:28:19 -0500
commit734d1ece37fbf3d2ddfc71bc6c69e0fe35f02542 (patch)
treec4805dd7e746b1feb9e09e9849f3245d0b2c0c6b /fs/proc/array.c
parent216c82c6aba63eeb49d7654b448e0d47bea255bb (diff)
parent9931faca02c604c22335f5a935a501bb2ace6e20 (diff)
Merge tag 'v3.8-rc3' into v4l_for_linus
Linux 3.8-rc3 * tag 'v3.8-rc3': (11110 commits) Linux 3.8-rc3 mm: reinstante dropped pmd_trans_splitting() check cred: Remove tgcred pointer from struct cred drm/ttm: fix fence locking in ttm_buffer_object_transfer ARM: clps711x: Fix bad merge of clockevents setup ARM: highbank: save and restore L2 cache and GIC on suspend ARM: highbank: add a power request clear ARM: highbank: fix secondary boot and hotplug ARM: highbank: fix typos with hignbank in power request functions ARM: dts: fix highbank cpu mpidr values ARM: dts: add device_type prop to cpu nodes on Calxeda platforms drm/prime: drop reference on imported dma-buf come from gem xen/netfront: improve truesize tracking ARM: mx5: Fix MX53 flexcan2 clock ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array sctp: fix Kconfig bug in default cookie hmac selection EDAC: Cleanup device deregistering path EDAC: Fix EDAC Kconfig menu EDAC: Fix kernel panic on module unloading ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec) ...
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index c1c207c36cae..6a91e6ffbcbd 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -162,7 +162,7 @@ static inline const char *get_task_state(struct task_struct *tsk)
162static inline void task_state(struct seq_file *m, struct pid_namespace *ns, 162static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
163 struct pid *pid, struct task_struct *p) 163 struct pid *pid, struct task_struct *p)
164{ 164{
165 struct user_namespace *user_ns = current_user_ns(); 165 struct user_namespace *user_ns = seq_user_ns(m);
166 struct group_info *group_info; 166 struct group_info *group_info;
167 int g; 167 int g;
168 struct fdtable *fdt = NULL; 168 struct fdtable *fdt = NULL;
@@ -212,7 +212,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
212 group_info = cred->group_info; 212 group_info = cred->group_info;
213 task_unlock(p); 213 task_unlock(p);
214 214
215 for (g = 0; g < min(group_info->ngroups, NGROUPS_SMALL); g++) 215 for (g = 0; g < group_info->ngroups; g++)
216 seq_printf(m, "%d ", 216 seq_printf(m, "%d ",
217 from_kgid_munged(user_ns, GROUP_AT(group_info, g))); 217 from_kgid_munged(user_ns, GROUP_AT(group_info, g)));
218 put_cred(cred); 218 put_cred(cred);
@@ -220,7 +220,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
220 seq_putc(m, '\n'); 220 seq_putc(m, '\n');
221} 221}
222 222
223static void render_sigset_t(struct seq_file *m, const char *header, 223void render_sigset_t(struct seq_file *m, const char *header,
224 sigset_t *set) 224 sigset_t *set)
225{ 225{
226 int i; 226 int i;
@@ -308,6 +308,10 @@ static void render_cap_t(struct seq_file *m, const char *header,
308 seq_putc(m, '\n'); 308 seq_putc(m, '\n');
309} 309}
310 310
311/* Remove non-existent capabilities */
312#define NORM_CAPS(v) (v.cap[CAP_TO_INDEX(CAP_LAST_CAP)] &= \
313 CAP_TO_MASK(CAP_LAST_CAP + 1) - 1)
314
311static inline void task_cap(struct seq_file *m, struct task_struct *p) 315static inline void task_cap(struct seq_file *m, struct task_struct *p)
312{ 316{
313 const struct cred *cred; 317 const struct cred *cred;
@@ -321,12 +325,24 @@ static inline void task_cap(struct seq_file *m, struct task_struct *p)
321 cap_bset = cred->cap_bset; 325 cap_bset = cred->cap_bset;
322 rcu_read_unlock(); 326 rcu_read_unlock();
323 327
328 NORM_CAPS(cap_inheritable);
329 NORM_CAPS(cap_permitted);
330 NORM_CAPS(cap_effective);
331 NORM_CAPS(cap_bset);
332
324 render_cap_t(m, "CapInh:\t", &cap_inheritable); 333 render_cap_t(m, "CapInh:\t", &cap_inheritable);
325 render_cap_t(m, "CapPrm:\t", &cap_permitted); 334 render_cap_t(m, "CapPrm:\t", &cap_permitted);
326 render_cap_t(m, "CapEff:\t", &cap_effective); 335 render_cap_t(m, "CapEff:\t", &cap_effective);
327 render_cap_t(m, "CapBnd:\t", &cap_bset); 336 render_cap_t(m, "CapBnd:\t", &cap_bset);
328} 337}
329 338
339static inline void task_seccomp(struct seq_file *m, struct task_struct *p)
340{
341#ifdef CONFIG_SECCOMP
342 seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode);
343#endif
344}
345
330static inline void task_context_switch_counts(struct seq_file *m, 346static inline void task_context_switch_counts(struct seq_file *m,
331 struct task_struct *p) 347 struct task_struct *p)
332{ 348{
@@ -360,6 +376,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
360 } 376 }
361 task_sig(m, task); 377 task_sig(m, task);
362 task_cap(m, task); 378 task_cap(m, task);
379 task_seccomp(m, task);
363 task_cpus_allowed(m, task); 380 task_cpus_allowed(m, task);
364 cpuset_task_status_allowed(m, task); 381 cpuset_task_status_allowed(m, task);
365 task_context_switch_counts(m, task); 382 task_context_switch_counts(m, task);
@@ -438,7 +455,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
438 455
439 min_flt += sig->min_flt; 456 min_flt += sig->min_flt;
440 maj_flt += sig->maj_flt; 457 maj_flt += sig->maj_flt;
441 thread_group_times(task, &utime, &stime); 458 thread_group_cputime_adjusted(task, &utime, &stime);
442 gtime += sig->gtime; 459 gtime += sig->gtime;
443 } 460 }
444 461
@@ -454,7 +471,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
454 if (!whole) { 471 if (!whole) {
455 min_flt = task->min_flt; 472 min_flt = task->min_flt;
456 maj_flt = task->maj_flt; 473 maj_flt = task->maj_flt;
457 task_times(task, &utime, &stime); 474 task_cputime_adjusted(task, &utime, &stime);
458 gtime = task->gtime; 475 gtime = task->gtime;
459 } 476 }
460 477