diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 23:58:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 23:58:12 -0500 |
commit | 848b81415c42ff3dc9a4204749087b015c37ef66 (patch) | |
tree | 391da3a73aea48632248220d2d6b8d45a88f7eae /fs/proc/array.c | |
parent | 992956189de58cae9f2be40585bc25105cd7c5ad (diff) | |
parent | 6fd59a83b9261fa53eaf98fb5514abba504a3ea3 (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton:
"Incoming:
- lots of misc stuff
- backlight tree updates
- lib/ updates
- Oleg's percpu-rwsem changes
- checkpatch
- rtc
- aoe
- more checkpoint/restart support
I still have a pile of MM stuff pending - Pekka should be merging
later today after which that is good to go. A number of other things
are twiddling thumbs awaiting maintainer merges."
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (180 commits)
scatterlist: don't BUG when we can trivially return a proper error.
docs: update documentation about /proc/<pid>/fdinfo/<fd> fanotify output
fs, fanotify: add @mflags field to fanotify output
docs: add documentation about /proc/<pid>/fdinfo/<fd> output
fs, notify: add procfs fdinfo helper
fs, exportfs: add exportfs_encode_inode_fh() helper
fs, exportfs: escape nil dereference if no s_export_op present
fs, epoll: add procfs fdinfo helper
fs, eventfd: add procfs fdinfo helper
procfs: add ability to plug in auxiliary fdinfo providers
tools/testing/selftests/kcmp/kcmp_test.c: print reason for failure in kcmp_test
breakpoint selftests: print failure status instead of cause make error
kcmp selftests: print fail status instead of cause make error
kcmp selftests: make run_tests fix
mem-hotplug selftests: print failure status instead of cause make error
cpu-hotplug selftests: print failure status instead of cause make error
mqueue selftests: print failure status instead of cause make error
vm selftests: print failure status instead of cause make error
ubifs: use prandom_bytes
mtd: nandsim: use prandom_bytes
...
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index d66248a1919b..6a91e6ffbcbd 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -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 | ||
223 | static void render_sigset_t(struct seq_file *m, const char *header, | 223 | void 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 | |||
311 | static inline void task_cap(struct seq_file *m, struct task_struct *p) | 315 | static 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 | ||
339 | static 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 | |||
330 | static inline void task_context_switch_counts(struct seq_file *m, | 346 | static 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); |