Skip to contentSkip to conversation

proc: making "limits" world readable

RFC PATCH Superseded Jiri Olsa 4 participants 8 messages Sep 21, 2010 – Sep 27, 2010 Proc filesystem

lore
Share & tools
lore

Jiri Olsa

author
#0 lore raw

RFC PATCH 1/1 proc: making "limits" world readable

hi,

I'd like to have the /proc/<pid>/limits file world readable, but I'm not sure this could cause some security issue.. thoughts?

The "limit" file was as a debug feature by following commit:
- proc: export a processes resource limits via /proc/pid commit d85f50d5e1aa99ab082035f94265847521819e58
Author: Neil Horman <[email protected]>

thanks for any ideas,
jirka

---
 fs/proc/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/proc/base.c +2 -2
index a1c43e7..8e4adda 100644
@@ -2675,7 +2675,7 @@ static const struct pid_entry tgid_base_stuff[] = {
 	INF("auxv",       S_IRUSR, proc_pid_auxv),
 	ONE("status",     S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	  S_IRUSR, proc_pid_limits),
+	INF("limits",	  S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",      S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
@@ -3011,7 +3011,7 @@ static const struct pid_entry tid_base_stuff[] = {
 	INF("auxv",      S_IRUSR, proc_pid_auxv),
 	ONE("status",    S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	 S_IRUSR, proc_pid_limits),
+	INF("limits",	 S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",     S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa <[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Why?

Quoted 36 lines

but I'm not sure this could cause some security issue.. thoughts?

The "limit" file was as a debug feature by following commit:
- proc: export a processes resource limits via /proc/pid commit d85f50d5e1aa99ab082035f94265847521819e58
Author: Neil Horman <[email protected]>

thanks for any ideas,
jirka

---
 fs/proc/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/proc/base.c +2 -2
index a1c43e7..8e4adda 100644
@@ -2675,7 +2675,7 @@ static const struct pid_entry tgid_base_stuff[] = {
 	INF("auxv",       S_IRUSR, proc_pid_auxv),
 	ONE("status",     S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	  S_IRUSR, proc_pid_limits),
+	INF("limits",	  S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",      S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
@@ -3011,7 +3011,7 @@ static const struct pid_entry tid_base_stuff[] = {
 	INF("auxv",      S_IRUSR, proc_pid_auxv),
 	ONE("status",    S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	 S_IRUSR, proc_pid_limits),
+	INF("limits",	 S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",     S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
author
#2 lore raw
Quoted 9 lines · Andrew Morton
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa <[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Why?

having this will ease the task of system management for large install bases and where root privileges might be restricted

jirka

Quoted 37 lines
Quoted 36 lines

but I'm not sure this could cause some security issue.. thoughts?

The "limit" file was as a debug feature by following commit:
- proc: export a processes resource limits via /proc/pid commit d85f50d5e1aa99ab082035f94265847521819e58
Author: Neil Horman <[email protected]>

thanks for any ideas,
jirka

---
 fs/proc/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/proc/base.c +2 -2
index a1c43e7..8e4adda 100644
@@ -2675,7 +2675,7 @@ static const struct pid_entry tgid_base_stuff[] = {
 	INF("auxv",       S_IRUSR, proc_pid_auxv),
 	ONE("status",     S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	  S_IRUSR, proc_pid_limits),
+	INF("limits",	  S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",      S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
@@ -3011,7 +3011,7 @@ static const struct pid_entry tid_base_stuff[] = {
 	INF("auxv",      S_IRUSR, proc_pid_auxv),
 	ONE("status",    S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	 S_IRUSR, proc_pid_limits),
+	INF("limits",	 S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",     S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
Acked-by
#3 lore raw
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa <[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Quoted 8 lines
Quoted 2 lines

Why?

having this will ease the task of system management for large install bases and where root privileges might be restricted

jirka

I don't see a problem with making this file world readable. Doing so would be in keeping with most of the other stats bearing files in /proc/<pid>. The only reason I didn't make it world readable was because the getrlimit sematics previously kept limit information private to the process, and I didn't want to deviate from that. But as long as we're not making it world writeable I think we're ok.

#4 lore raw
Quoted 17 lines · On Fri, 24 Sep 2010 12:20:07 -0400 Neil Horman <[email protected]> wrote:
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa <[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Quoted 8 lines
Quoted 2 lines

Why?

having this will ease the task of system management for large install bases and where root privileges might be restricted

jirka

Quoted 9 lines

I don't see a problem with making this file world readable. Doing so would be in keeping with most of the other stats bearing files in /proc/<pid>. The only reason I didn't make it world readable was because the getrlimit sematics previously kept limit information private to the process, and I didn't want to deviate from that. But as long as we're not making it world writeable I think we're ok.

hm, OK, I can't really think of any realistic problem with exposing limits.

The original patch had no signoff. Please resend, with a changelog which includes a *good* rationale for making the change. For example, a use case.

author
#5 lore raw

PATCH v2 1/1 proc: making "limits" world readable

Quoted 27 lines · Andrew Morton
Quoted 24 lines · On Fri, 24 Sep 2010 12:20:07 -0400 Neil Horman <[email protected]> wrote:
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa <[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Quoted 8 lines
Quoted 2 lines

Why?

having this will ease the task of system management for large install bases and where root privileges might be restricted

jirka

I don't see a problem with making this file world readable. Doing so would be in keeping with most of the other stats bearing files in /proc/<pid>. The only reason I didn't make it world readable was because the getrlimit sematics previously kept limit information private to the process, and I didn't want to deviate from that. But as long as we're not making it world writeable I think we're ok.

Quoted 9 lines
Quoted 2 lines

hm, OK, I can't really think of any realistic problem with exposing limits.

The original patch had no signoff. Please resend, with a changelog which includes a *good* rationale for making the change. For example, a use case.

thanks for feedback, the patch is attached

jirka

---
making the /proc/<pid>/limits file world readable.

Having the limits file world readable will ease the task of system management on systems where root privileges might be restricted.

Having admin restricted with root proviledges, he/she could not check other users process' limits.

Also it'd align with most of the /proc stat files.

wbr,
jirka

---
 fs/proc/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/proc/base.c +2 -2
index a1c43e7..8e4adda 100644
@@ -2675,7 +2675,7 @@ static const struct pid_entry tgid_base_stuff[] = {
 	INF("auxv",       S_IRUSR, proc_pid_auxv),
 	ONE("status",     S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	  S_IRUSR, proc_pid_limits),
+	INF("limits",	  S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",      S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
@@ -3011,7 +3011,7 @@ static const struct pid_entry tid_base_stuff[] = {
 	INF("auxv",      S_IRUSR, proc_pid_auxv),
 	ONE("status",    S_IRUGO, proc_pid_status),
 	ONE("personality", S_IRUSR, proc_pid_personality),
-	INF("limits",	 S_IRUSR, proc_pid_limits),
+	INF("limits",	 S_IRUGO, proc_pid_limits),
 #ifdef CONFIG_SCHED_DEBUG
 	REG("sched",     S_IRUGO|S_IWUSR, proc_pid_sched_operations),
 #endif
Signature · 1 line
1.7.1
Acked-by on v2 1/1
#6 lore raw
Quoted 51 lines · Jiri Olsa
Quoted 27 lines · Andrew Morton
Quoted 24 lines · On Fri, 24 Sep 2010 12:20:07 -0400 Neil Horman <[email protected]> wrote:
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa <[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Quoted 8 lines
Quoted 2 lines

Why?

having this will ease the task of system management for large install bases and where root privileges might be restricted

jirka

I don't see a problem with making this file world readable. Doing so would be in keeping with most of the other stats bearing files in /proc/<pid>. The only reason I didn't make it world readable was because the getrlimit sematics previously kept limit information private to the process, and I didn't want to deviate from that. But as long as we're not making it world writeable I think we're ok.

Quoted 9 lines
Quoted 2 lines

hm, OK, I can't really think of any realistic problem with exposing limits.

The original patch had no signoff. Please resend, with a changelog which includes a *good* rationale for making the change. For example, a use case.

thanks for feedback, the patch is attached

jirka

---
making the /proc/<pid>/limits file world readable.

Having the limits file world readable will ease the task of system management on systems where root privileges might be restricted.

Having admin restricted with root proviledges, he/she could not check other users process' limits.

Quoted 7 lines

Also it'd align with most of the /proc stat files.

wbr,
jirka

#7 lore raw
In reply to Neil Horman
Quoted 17 lines · Neil Horman
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue, 21 Sep 2010 11:10:55 +0200 Jiri Olsa<[email protected]> wrote:

hi,

I'd like to have the /proc/<pid>/limits file world readable,

Quoted 8 lines
Quoted 2 lines

Why?

having this will ease the task of system management for large install bases and where root privileges might be restricted

jirka

Quoted 8 lines

I don't see a problem with making this file world readable. Doing so would be in keeping with most of the other stats bearing files in /proc/<pid>. The only reason I didn't make it world readable was because the getrlimit sematics previously kept limit information private to the process, and I didn't want to deviate from that. But as long as we're not making it world writeable I think we're ok.

I agree with Neil. I can't see how this can be a problem as long as it is just world-readable.

Eugene

Signature · 1 line
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }