linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Xu <dxu@dxuuu.xyz>
To: adobriyan@gmail.com, christian@brauner.io,
	akpm@linux-foundation.org, tglx@linutronix.de, mhocko@suse.com,
	keescook@chromium.org, shakeelb@google.com,
	casey@schaufler-ca.com, khlebnikov@yandex-team.ru,
	kent.overstreet@gmail.com, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Cc: Daniel Xu <dxu@dxuuu.xyz>,
	dschatzberg@fb.com, htejun@fb.com, dennis@kernel.org,
	kernel-team@fb.com
Subject: [PATCH] proc: Make /proc/<pid>/io world readable
Date: Thu, 21 Nov 2019 13:09:09 -0800	[thread overview]
Message-ID: <20191121210909.15086-1-dxu@dxuuu.xyz> (raw)

/proc/<pid>/io is currently only owner readable. This forces monitoring
programs (such as atop) to run with elevated permissions to collect disk
stats. Changing this file to world readable can add a measure of safety to
userspace.

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 fs/proc/base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index ebea9501afb8..1d1c1d680e16 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3076,7 +3076,7 @@ static const struct pid_entry tgid_base_stuff[] = {
 	REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations),
 #endif
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-	ONE("io",	S_IRUSR, proc_tgid_io_accounting),
+	ONE("io",	S_IRUGO, proc_tgid_io_accounting),
 #endif
 #ifdef CONFIG_USER_NS
 	REG("uid_map",    S_IRUGO|S_IWUSR, proc_uid_map_operations),
@@ -3473,7 +3473,7 @@ static const struct pid_entry tid_base_stuff[] = {
 	REG("fail-nth", 0644, proc_fail_nth_operations),
 #endif
 #ifdef CONFIG_TASK_IO_ACCOUNTING
-	ONE("io",	S_IRUSR, proc_tid_io_accounting),
+	ONE("io",	S_IRUGO, proc_tid_io_accounting),
 #endif
 #ifdef CONFIG_USER_NS
 	REG("uid_map",    S_IRUGO|S_IWUSR, proc_uid_map_operations),
-- 
2.21.0


             reply	other threads:[~2019-11-21 21:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 21:09 Daniel Xu [this message]
2019-11-21 21:25 ` [PATCH] proc: Make /proc/<pid>/io world readable Daniel Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191121210909.15086-1-dxu@dxuuu.xyz \
    --to=dxu@dxuuu.xyz \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=casey@schaufler-ca.com \
    --cc=christian@brauner.io \
    --cc=dennis@kernel.org \
    --cc=dschatzberg@fb.com \
    --cc=htejun@fb.com \
    --cc=keescook@chromium.org \
    --cc=kent.overstreet@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=shakeelb@google.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).