Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Julius Hemanth Pitti <jpitti@cisco.com>
To: keescook@chromium.org, yzaikin@google.com, mcgrof@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	akpm@linux-foundation.org, mingo@elte.hu,
	viro@zeniv.linux.org.uk, xe-linux-external@cisco.com,
	Julius Hemanth Pitti <jpitti@cisco.com>
Subject: [PATCH] proc/sysctl: make protected_* world readable
Date: Thu,  9 Jul 2020 16:51:15 -0700	[thread overview]
Message-ID: <20200709235115.56954-1-jpitti@cisco.com> (raw)

protected_* files have 600 permissions which prevents
non-superuser from reading them.

Container like "AWS greengrass" refuse to launch unless
protected_hardlinks and protected_symlinks are set. When
containers like these run with "userns-remap" or "--user"
mapping container's root to non-superuser on host, they
fail to run due to denied read access to these files.

As these protections are hardly a secret, and do not
possess any security risk, making them world readable.

Though above greengrass usecase needs read access to
only protected_hardlinks and protected_symlinks files,
setting all other protected_* files to 644 to keep
consistency.

Fixes: 800179c9b8a1 ("fs: add link restrictions")
Signed-off-by: Julius Hemanth Pitti <jpitti@cisco.com>
---
 kernel/sysctl.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index db1ce7a..aeca2fd 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -3223,7 +3223,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
 		.procname	= "protected_symlinks",
 		.data		= &sysctl_protected_symlinks,
 		.maxlen		= sizeof(int),
-		.mode		= 0600,
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= SYSCTL_ONE,
@@ -3232,7 +3232,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
 		.procname	= "protected_hardlinks",
 		.data		= &sysctl_protected_hardlinks,
 		.maxlen		= sizeof(int),
-		.mode		= 0600,
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= SYSCTL_ONE,
@@ -3241,7 +3241,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
 		.procname	= "protected_fifos",
 		.data		= &sysctl_protected_fifos,
 		.maxlen		= sizeof(int),
-		.mode		= 0600,
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= &two,
@@ -3250,7 +3250,7 @@ int proc_do_static_key(struct ctl_table *table, int write,
 		.procname	= "protected_regular",
 		.data		= &sysctl_protected_regular,
 		.maxlen		= sizeof(int),
-		.mode		= 0600,
+		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= &two,
-- 
1.7.1


             reply	other threads:[~2020-07-09 23:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 23:51 Julius Hemanth Pitti [this message]
2020-07-10  4:31 ` Kees Cook
2020-07-29  0:03   ` Luis Chamberlain

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=20200709235115.56954-1-jpitti@cisco.com \
    --to=jpitti@cisco.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mingo@elte.hu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xe-linux-external@cisco.com \
    --cc=yzaikin@google.com \
    --subject='Re: [PATCH] proc/sysctl: make protected_* world readable' \
    /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

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).