| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- From d03b4d2a3e43228bb98fae4c6f5365d4f9d00f4c Mon Sep 17 00:00:00 2001
- From: Borislav Petkov <[email protected]>
- Date: Mon, 4 Dec 2017 15:08:04 +0100
- Subject: [PATCH 215/231] x86/mm/dump_pagetables: Add page table directory to
- the debugfs VFS hierarchy
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- The upcoming support for dumping the kernel and the user space page tables
- of the current process would create more random files in the top level
- debugfs directory.
- Add a page table directory and move the existing file to it.
- Signed-off-by: Borislav Petkov <[email protected]>
- Signed-off-by: Thomas Gleixner <[email protected]>
- Cc: Andy Lutomirski <[email protected]>
- Cc: Boris Ostrovsky <[email protected]>
- Cc: Borislav Petkov <[email protected]>
- Cc: Brian Gerst <[email protected]>
- Cc: Dave Hansen <[email protected]>
- Cc: David Laight <[email protected]>
- Cc: Denys Vlasenko <[email protected]>
- Cc: Eduardo Valentin <[email protected]>
- Cc: Greg KH <[email protected]>
- Cc: H. Peter Anvin <[email protected]>
- Cc: Josh Poimboeuf <[email protected]>
- Cc: Juergen Gross <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Peter Zijlstra <[email protected]>
- Cc: Will Deacon <[email protected]>
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Cc: [email protected]
- Signed-off-by: Ingo Molnar <[email protected]>
- (cherry picked from commit 75298aa179d56cd64f54e58a19fffc8ab922b4c0)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit ae5c4af9bbefed4adc12075c28fb5889547c99cc)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- arch/x86/mm/debug_pagetables.c | 15 ++++++++++-----
- 1 file changed, 10 insertions(+), 5 deletions(-)
- diff --git a/arch/x86/mm/debug_pagetables.c b/arch/x86/mm/debug_pagetables.c
- index bfcffdf6c577..d1449fb6dc7a 100644
- --- a/arch/x86/mm/debug_pagetables.c
- +++ b/arch/x86/mm/debug_pagetables.c
- @@ -22,21 +22,26 @@ static const struct file_operations ptdump_fops = {
- .release = single_release,
- };
-
- -static struct dentry *pe;
- +static struct dentry *dir, *pe;
-
- static int __init pt_dump_debug_init(void)
- {
- - pe = debugfs_create_file("kernel_page_tables", S_IRUSR, NULL, NULL,
- - &ptdump_fops);
- - if (!pe)
- + dir = debugfs_create_dir("page_tables", NULL);
- + if (!dir)
- return -ENOMEM;
-
- + pe = debugfs_create_file("kernel", 0400, dir, NULL, &ptdump_fops);
- + if (!pe)
- + goto err;
- return 0;
- +err:
- + debugfs_remove_recursive(dir);
- + return -ENOMEM;
- }
-
- static void __exit pt_dump_debug_exit(void)
- {
- - debugfs_remove_recursive(pe);
- + debugfs_remove_recursive(dir);
- }
-
- module_init(pt_dump_debug_init);
- --
- 2.14.2
|