Skip to contentSkip to conversation

lockdown: Allow unprivileged users to see lockdown status

PATCH Superseded Jeremy Cline 2 participants 6 messages Feb 20, 2020 – May 14, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lockdown: Allow unprivileged users to see lockdown status

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 <[email protected]>
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/lockdown/lockdown.c +1 -1
index 5a952617a0eb..87cbdc64d272 100644
@@ -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);
 }
Signature · 1 line
2.24.1
maintainer
#1 lore raw
Quoted 9 lines · Jeremy Cline

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 <[email protected]>

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

Quoted 18 lines
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/lockdown/lockdown.c +1 -1
index 5a952617a0eb..87cbdc64d272 100644
@@ -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);
 }
Signature · 2 lines
James Morris
<[email protected]>
#2 lore raw
Quoted 8 lines · James Morris
Quoted 6 lines · Jeremy Cline

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.

Quoted 6 lines
Quoted 3 lines
Fixes 000d388ed3bb ("security: Add a static lockdown policy LSM")
Cc Frank Ch. Eigler <[email protected]>

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

Can we take resounding silence as no objections?

- Jeremy

Quoted 23 lines
Quoted 18 lines
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/lockdown/lockdown.c +1 -1
index 5a952617a0eb..87cbdc64d272 100644
@@ -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);
 }
Signature · 2 lines
James Morris
<[email protected]>
maintainer
#3 lore raw
Quoted 9 lines · Jeremy Cline
Quoted 8 lines · James Morris
Quoted 6 lines · Jeremy Cline

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.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Fixes 000d388ed3bb ("security: Add a static lockdown policy LSM")
Cc Frank Ch. Eigler <[email protected]>

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.

Quoted 27 lines

- Jeremy

Quoted 23 lines
Quoted 18 lines
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/lockdown/lockdown.c +1 -1
index 5a952617a0eb..87cbdc64d272 100644
@@ -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);
 }
Signature · 2 lines
James Morris
<[email protected]>
Signature · 2 lines
James Morris
<[email protected]>
#4 lore raw

PATCH RESEND 1/1 lockdown: Allow unprivileged users to see lockdown status

In reply to Jeremy Cline

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 <[email protected]>
---
 security/lockdown/lockdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/lockdown/lockdown.c +1 -1
index 5a952617a0eba..87cbdc64d272c 100644
@@ -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);
 }
Signature · 1 line
2.26.2
maintainer
#5 lore raw
Quoted 9 lines · Jeremy Cline

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 <[email protected]>

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

Signature · 2 lines
James Morris
<[email protected]>