From: David Howells Date: Wed, 8 Nov 2017 15:11:37 +0000 (+0000) Subject: Lock down /proc/kcore X-Git-Tag: archive/raspbian/4.15.11-1+rpi1^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2ae1de956ead5ff52415707041c39b3cf0875675;p=linux.git Lock down /proc/kcore Disallow access to /proc/kcore when the kernel is locked down to prevent access to cryptographic data. Signed-off-by: David Howells Reviewed-by: James Morris Gbp-Pq: Topic features/all/lockdown Gbp-Pq: Name 0025-Lock-down-proc-kcore.patch --- diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index e8a93bc8285..e463ef48966 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -542,6 +542,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;