From: Borislav Petkov Date: Mon, 30 Nov 2015 12:12:59 +0000 (+0100) Subject: x86/mm/ptdump: Make (debugfs)/kernel_page_tables read-only X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=071ac0c4e8e90d5de05f0779b03ae69ce84820d5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git x86/mm/ptdump: Make (debugfs)/kernel_page_tables read-only File should be created with S_IRUSR and not with S_IWUSR too because writing to it doesn't make any sense. I mean, we don't have a ->write method anyway but let's have the permissions correct too. Signed-off-by: Borislav Petkov Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arjan van de Ven Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Kees Cook Cc: Linus Torvalds Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1448885579-32506-1-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/mm/debug_pagetables.c b/arch/x86/mm/debug_pagetables.c index b35ee86a9316..bfcffdf6c577 100644 --- a/arch/x86/mm/debug_pagetables.c +++ b/arch/x86/mm/debug_pagetables.c @@ -26,7 +26,7 @@ static struct dentry *pe; static int __init pt_dump_debug_init(void) { - pe = debugfs_create_file("kernel_page_tables", 0600, NULL, NULL, + pe = debugfs_create_file("kernel_page_tables", S_IRUSR, NULL, NULL, &ptdump_fops); if (!pe) return -ENOMEM;