Thread (57 messages) 57 messages, 15 authors, 2018-05-23
STALE2950d REVIEWED: 1 (0M)

[PATCH 20/24] Lock down /proc/kcore

From: David Howells <dhowells@redhat.com>
Date: 2018-04-11 16:26:53
Also in: linux-man, linux-security-module, lkml
Subsystem: filesystems (vfs and infrastructure), kcore, proc filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Omar Sandoval, Linus Torvalds

Disallow access to /proc/kcore when the kernel is locked down to prevent
access to cryptographic data.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <redacted>
---

 fs/proc/kcore.c |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index d1e82761de81..cdebdee81719 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -546,6 +546,8 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
 
 static int open_kcore(struct inode *inode, struct file *filp)
 {
+	if (kernel_is_locked_down("/proc/kcore"))
+		return -EPERM;
 	if (!capable(CAP_SYS_RAWIO))
 		return -EPERM;
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help