diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index d7fd1ca807d2..633a63462573 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -581,8 +581,10 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns, | |||
581 | /* | 581 | /* |
582 | * print the file header | 582 | * print the file header |
583 | */ | 583 | */ |
584 | seq_printf(m, "%-25s %-20s %-20s %-10s\n", | 584 | seq_puts(m, "Limit " |
585 | "Limit", "Soft Limit", "Hard Limit", "Units"); | 585 | "Soft Limit " |
586 | "Hard Limit " | ||
587 | "Units \n"); | ||
586 | 588 | ||
587 | for (i = 0; i < RLIM_NLIMITS; i++) { | 589 | for (i = 0; i < RLIM_NLIMITS; i++) { |
588 | if (rlim[i].rlim_cur == RLIM_INFINITY) | 590 | if (rlim[i].rlim_cur == RLIM_INFINITY) |
@@ -2356,10 +2358,13 @@ static ssize_t timerslack_ns_write(struct file *file, const char __user *buf, | |||
2356 | return -ESRCH; | 2358 | return -ESRCH; |
2357 | 2359 | ||
2358 | if (p != current) { | 2360 | if (p != current) { |
2359 | if (!capable(CAP_SYS_NICE)) { | 2361 | rcu_read_lock(); |
2362 | if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) { | ||
2363 | rcu_read_unlock(); | ||
2360 | count = -EPERM; | 2364 | count = -EPERM; |
2361 | goto out; | 2365 | goto out; |
2362 | } | 2366 | } |
2367 | rcu_read_unlock(); | ||
2363 | 2368 | ||
2364 | err = security_task_setscheduler(p); | 2369 | err = security_task_setscheduler(p); |
2365 | if (err) { | 2370 | if (err) { |
@@ -2392,11 +2397,14 @@ static int timerslack_ns_show(struct seq_file *m, void *v) | |||
2392 | return -ESRCH; | 2397 | return -ESRCH; |
2393 | 2398 | ||
2394 | if (p != current) { | 2399 | if (p != current) { |
2395 | 2400 | rcu_read_lock(); | |
2396 | if (!capable(CAP_SYS_NICE)) { | 2401 | if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) { |
2402 | rcu_read_unlock(); | ||
2397 | err = -EPERM; | 2403 | err = -EPERM; |
2398 | goto out; | 2404 | goto out; |
2399 | } | 2405 | } |
2406 | rcu_read_unlock(); | ||
2407 | |||
2400 | err = security_task_getscheduler(p); | 2408 | err = security_task_getscheduler(p); |
2401 | if (err) | 2409 | if (err) |
2402 | goto out; | 2410 | goto out; |