From: David Howells Date: Mon, 18 Feb 2019 12:45:02 +0000 (+0000) Subject: Lock down /proc/kcore X-Git-Tag: archive/raspbian/5.2.17-1+rpi1^2~38 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=17a9e41e91a211d5b2bfbc0f2affab771ace2f06;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 0023-Lock-down-proc-kcore.patch --- diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index f5834488b67..0639228c490 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -545,6 +545,8 @@ out: 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;