x86/mm/ptdump: Make (debugfs)/kernel_page_tables read-only
authorBorislav Petkov <bp@suse.de>
Mon, 30 Nov 2015 12:12:59 +0000 (13:12 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 4 Dec 2015 11:55:01 +0000 (12:55 +0100)
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 <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1448885579-32506-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/mm/debug_pagetables.c

index b35ee86a9316b6f51ed7d6b3136e576c309f7711..bfcffdf6c5775f7ac5bd4c9f768573d7ae7bba55 100644 (file)
@@ -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;