linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lockdown: Allow unprivileged users to see lockdown status
@ 2020-02-20 15:17 Jeremy Cline
  2020-02-21 16:51 ` James Morris
  2020-05-14 14:05 ` [PATCH RESEND] " Jeremy Cline
  0 siblings, 2 replies; 6+ messages in thread
From: Jeremy Cline @ 2020-02-20 15:17 UTC (permalink / raw)
  To: James Morris, Serge E . Hallyn
  Cc: Matthew Garrett, David Howells, linux-security-module,
	linux-kernel, Jeremy Cline, Frank Ch . Eigler

A number of userspace tools, such as systemtap, need a way to see the
current lockdown state so they can gracefully deal with the kernel being
locked down. The state is already exposed in
/sys/kernel/security/lockdown, but is only readable by root. Adjust the
permissions so unprivileged users can read the state.

Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM")
Cc: Frank Ch. Eigler <fche@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
index 5a952617a0eb..87cbdc64d272 100644
--- a/security/lockdown/lockdown.c
+++ b/security/lockdown/lockdown.c
@@ -150,7 +150,7 @@ static int __init lockdown_secfs_init(void)
 {
 	struct dentry *dentry;
 
-	dentry = securityfs_create_file("lockdown", 0600, NULL, NULL,
+	dentry = securityfs_create_file("lockdown", 0644, NULL, NULL,
 					&lockdown_ops);
 	return PTR_ERR_OR_ZERO(dentry);
 }
-- 
2.24.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] lockdown: Allow unprivileged users to see lockdown status
  2020-02-20 15:17 [PATCH] lockdown: Allow unprivileged users to see lockdown status Jeremy Cline
@ 2020-02-21 16:51 ` James Morris
  2020-05-11 13:42   ` Jeremy Cline
  2020-05-14 14:05 ` [PATCH RESEND] " Jeremy Cline
  1 sibling, 1 reply; 6+ messages in thread
From: James Morris @ 2020-02-21 16:51 UTC (permalink / raw)
  To: Jeremy Cline
  Cc: Serge E . Hallyn, Matthew Garrett, David Howells,
	linux-security-module, linux-kernel, Frank Ch . Eigler

On Thu, 20 Feb 2020, Jeremy Cline wrote:

> A number of userspace tools, such as systemtap, need a way to see the
> current lockdown state so they can gracefully deal with the kernel being
> locked down. The state is already exposed in
> /sys/kernel/security/lockdown, but is only readable by root. Adjust the
> permissions so unprivileged users can read the state.
> 
> Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM")
> Cc: Frank Ch. Eigler <fche@redhat.com>
> Signed-off-by: Jeremy Cline <jcline@redhat.com>

Looks fine to me, any objection from Matthew or others?

> ---
>  security/lockdown/lockdown.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
> index 5a952617a0eb..87cbdc64d272 100644
> --- a/security/lockdown/lockdown.c
> +++ b/security/lockdown/lockdown.c
> @@ -150,7 +150,7 @@ static int __init lockdown_secfs_init(void)
>  {
>  	struct dentry *dentry;
>  
> -	dentry = securityfs_create_file("lockdown", 0600, NULL, NULL,
> +	dentry = securityfs_create_file("lockdown", 0644, NULL, NULL,
>  					&lockdown_ops);
>  	return PTR_ERR_OR_ZERO(dentry);
>  }
> 

-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] lockdown: Allow unprivileged users to see lockdown status
  2020-02-21 16:51 ` James Morris
@ 2020-05-11 13:42   ` Jeremy Cline
  2020-05-14  2:43     ` James Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Cline @ 2020-05-11 13:42 UTC (permalink / raw)
  To: James Morris
  Cc: Serge E . Hallyn, Matthew Garrett, David Howells,
	linux-security-module, linux-kernel, Frank Ch . Eigler

On Sat, Feb 22, 2020 at 03:51:24AM +1100, James Morris wrote:
> On Thu, 20 Feb 2020, Jeremy Cline wrote:
> 
> > A number of userspace tools, such as systemtap, need a way to see the
> > current lockdown state so they can gracefully deal with the kernel being
> > locked down. The state is already exposed in
> > /sys/kernel/security/lockdown, but is only readable by root. Adjust the
> > permissions so unprivileged users can read the state.
> > 
> > Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM")
> > Cc: Frank Ch. Eigler <fche@redhat.com>
> > Signed-off-by: Jeremy Cline <jcline@redhat.com>
> 
> Looks fine to me, any objection from Matthew or others?
> 

Can we take resounding silence as no objections?

- Jeremy

> > ---
> >  security/lockdown/lockdown.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
> > index 5a952617a0eb..87cbdc64d272 100644
> > --- a/security/lockdown/lockdown.c
> > +++ b/security/lockdown/lockdown.c
> > @@ -150,7 +150,7 @@ static int __init lockdown_secfs_init(void)
> >  {
> >  	struct dentry *dentry;
> >  
> > -	dentry = securityfs_create_file("lockdown", 0600, NULL, NULL,
> > +	dentry = securityfs_create_file("lockdown", 0644, NULL, NULL,
> >  					&lockdown_ops);
> >  	return PTR_ERR_OR_ZERO(dentry);
> >  }
> > 
> 
> -- 
> James Morris
> <jmorris@namei.org>
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] lockdown: Allow unprivileged users to see lockdown status
  2020-05-11 13:42   ` Jeremy Cline
@ 2020-05-14  2:43     ` James Morris
  0 siblings, 0 replies; 6+ messages in thread
From: James Morris @ 2020-05-14  2:43 UTC (permalink / raw)
  To: Jeremy Cline
  Cc: Serge E . Hallyn, Matthew Garrett, David Howells,
	linux-security-module, linux-kernel, Frank Ch . Eigler

On Mon, 11 May 2020, Jeremy Cline wrote:

> On Sat, Feb 22, 2020 at 03:51:24AM +1100, James Morris wrote:
> > On Thu, 20 Feb 2020, Jeremy Cline wrote:
> > 
> > > A number of userspace tools, such as systemtap, need a way to see the
> > > current lockdown state so they can gracefully deal with the kernel being
> > > locked down. The state is already exposed in
> > > /sys/kernel/security/lockdown, but is only readable by root. Adjust the
> > > permissions so unprivileged users can read the state.
> > > 
> > > Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM")
> > > Cc: Frank Ch. Eigler <fche@redhat.com>
> > > Signed-off-by: Jeremy Cline <jcline@redhat.com>
> > 
> > Looks fine to me, any objection from Matthew or others?
> > 
> 
> Can we take resounding silence as no objections?

Please resend and I'll apply it to my tree.

> 
> - Jeremy
> 
> > > ---
> > >  security/lockdown/lockdown.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
> > > index 5a952617a0eb..87cbdc64d272 100644
> > > --- a/security/lockdown/lockdown.c
> > > +++ b/security/lockdown/lockdown.c
> > > @@ -150,7 +150,7 @@ static int __init lockdown_secfs_init(void)
> > >  {
> > >  	struct dentry *dentry;
> > >  
> > > -	dentry = securityfs_create_file("lockdown", 0600, NULL, NULL,
> > > +	dentry = securityfs_create_file("lockdown", 0644, NULL, NULL,
> > >  					&lockdown_ops);
> > >  	return PTR_ERR_OR_ZERO(dentry);
> > >  }
> > > 
> > 
> > -- 
> > James Morris
> > <jmorris@namei.org>
> > 
> 

-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH RESEND] lockdown: Allow unprivileged users to see lockdown status
  2020-02-20 15:17 [PATCH] lockdown: Allow unprivileged users to see lockdown status Jeremy Cline
  2020-02-21 16:51 ` James Morris
@ 2020-05-14 14:05 ` Jeremy Cline
  2020-05-14 17:28   ` James Morris
  1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Cline @ 2020-05-14 14:05 UTC (permalink / raw)
  To: James Morris, Serge E . Hallyn
  Cc: Matthew Garrett, David Howells, linux-security-module,
	linux-kernel, Jeremy Cline, Frank Ch . Eigler

A number of userspace tools, such as systemtap, need a way to see the
current lockdown state so they can gracefully deal with the kernel being
locked down. The state is already exposed in
/sys/kernel/security/lockdown, but is only readable by root. Adjust the
permissions so unprivileged users can read the state.

Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM")
Cc: Frank Ch. Eigler <fche@redhat.com>
Signed-off-by: Jeremy Cline <jcline@redhat.com>
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
index 5a952617a0eba..87cbdc64d272c 100644
--- a/security/lockdown/lockdown.c
+++ b/security/lockdown/lockdown.c
@@ -150,7 +150,7 @@ static int __init lockdown_secfs_init(void)
 {
 	struct dentry *dentry;
 
-	dentry = securityfs_create_file("lockdown", 0600, NULL, NULL,
+	dentry = securityfs_create_file("lockdown", 0644, NULL, NULL,
 					&lockdown_ops);
 	return PTR_ERR_OR_ZERO(dentry);
 }
-- 
2.26.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH RESEND] lockdown: Allow unprivileged users to see lockdown status
  2020-05-14 14:05 ` [PATCH RESEND] " Jeremy Cline
@ 2020-05-14 17:28   ` James Morris
  0 siblings, 0 replies; 6+ messages in thread
From: James Morris @ 2020-05-14 17:28 UTC (permalink / raw)
  To: Jeremy Cline
  Cc: Serge E . Hallyn, Matthew Garrett, David Howells,
	linux-security-module, linux-kernel, Frank Ch . Eigler

On Thu, 14 May 2020, Jeremy Cline wrote:

> A number of userspace tools, such as systemtap, need a way to see the
> current lockdown state so they can gracefully deal with the kernel being
> locked down. The state is already exposed in
> /sys/kernel/security/lockdown, but is only readable by root. Adjust the
> permissions so unprivileged users can read the state.
> 
> Fixes: 000d388ed3bb ("security: Add a static lockdown policy LSM")
> Cc: Frank Ch. Eigler <fche@redhat.com>
> Signed-off-by: Jeremy Cline <jcline@redhat.com>

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general


-- 
James Morris
<jmorris@namei.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-14 17:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 15:17 [PATCH] lockdown: Allow unprivileged users to see lockdown status Jeremy Cline
2020-02-21 16:51 ` James Morris
2020-05-11 13:42   ` Jeremy Cline
2020-05-14  2:43     ` James Morris
2020-05-14 14:05 ` [PATCH RESEND] " Jeremy Cline
2020-05-14 17:28   ` James Morris

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