diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2019-08-23 14:08:58 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2019-08-23 14:08:58 +1000 |
commit | 4f8be0b4e32f5a256bf9180468a67629bc5d553b (patch) | |
tree | c81b732b1396e8f60c7b30a4f090a191aed710ca /fs/proc/kcore.c | |
parent | 0033928515b57a09677c66a3e62a9054d16f4e6c (diff) | |
parent | b602614a81078bf29c82b2671bb96a63488f68d6 (diff) |
Merge remote-tracking branch 'security/next-testing'
# Conflicts:
# arch/s390/configs/debug_defconfig
# arch/s390/configs/defconfig
# arch/s390/configs/performance_defconfig
# fs/tracefs/inode.c
# kernel/trace/trace_kprobe.c
# security/integrity/ima/Kconfig
Diffstat (limited to 'fs/proc/kcore.c')
-rw-r--r-- | fs/proc/kcore.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index f5834488b67d..e2ed8e08cc7a 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -31,6 +31,7 @@ #include <linux/ioport.h> #include <linux/memory.h> #include <linux/sched/task.h> +#include <linux/security.h> #include <asm/sections.h> #include "internal.h" @@ -545,9 +546,14 @@ out: static int open_kcore(struct inode *inode, struct file *filp) { + int ret = security_locked_down(LOCKDOWN_KCORE); + if (!capable(CAP_SYS_RAWIO)) return -EPERM; + if (ret) + return ret; + filp->private_data = kmalloc(PAGE_SIZE, GFP_KERNEL); if (!filp->private_data) return -ENOMEM; |