aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@kernel.org>2016-05-10 17:10:29 -0400
committerIngo Molnar <mingo@kernel.org>2016-05-20 03:10:03 -0400
commitdc4fac84f8e66b147921ebdc385e767d5def7422 (patch)
tree7867ab702abfe0cc1cfb39acd99e18a259812849 /arch/x86/mm
parentd696ca016d579d43fc043f28ba656d9305fba651 (diff)
x86/mm: Switch from TASK_SIZE to TASK_SIZE_MAX in the page fault code
x86's page fault handlers had two TASK_SIZE uses that should have been TASK_SIZE_MAX. I don't think that either one had a visible effect, but this makes the code clearer and should save a few bytes of text. (And I eventually want to eradicate TASK_SIZE. This will help.) Reported-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andy Lutomirski <luto@kernel.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ruslan Kabatsayev <b7.10110111@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1242fb23b0d05c3069dbf5758ac55d26bc114bef.1462914565.git.luto@kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/fault.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 5ce1ed02f7e8..7d1fa7cd2374 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -292,7 +292,7 @@ void vmalloc_sync_all(void)
292 return; 292 return;
293 293
294 for (address = VMALLOC_START & PMD_MASK; 294 for (address = VMALLOC_START & PMD_MASK;
295 address >= TASK_SIZE && address < FIXADDR_TOP; 295 address >= TASK_SIZE_MAX && address < FIXADDR_TOP;
296 address += PMD_SIZE) { 296 address += PMD_SIZE) {
297 struct page *page; 297 struct page *page;
298 298
@@ -854,8 +854,13 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
854 return; 854 return;
855 } 855 }
856#endif 856#endif
857 /* Kernel addresses are always protection faults: */ 857
858 if (address >= TASK_SIZE) 858 /*
859 * To avoid leaking information about the kernel page table
860 * layout, pretend that user-mode accesses to kernel addresses
861 * are always protection faults.
862 */
863 if (address >= TASK_SIZE_MAX)
859 error_code |= PF_PROT; 864 error_code |= PF_PROT;
860 865
861 if (likely(show_unhandled_signals)) 866 if (likely(show_unhandled_signals))