Commit dc4fac84 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Ingo Molnar

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: default avatarCyrill Gorcunov <>
Signed-off-by: default avatarAndy Lutomirski <>
Cc: Andy Lutomirski <>
Cc: Borislav Petkov <>
Cc: Brian Gerst <>
Cc: Denys Vlasenko <>
Cc: Dmitry Safonov <>
Cc: H. Peter Anvin <>
Cc: Linus Torvalds <>
Cc: Oleg Nesterov <>
Cc: Pavel Emelyanov <>
Cc: Peter Zijlstra <>
Cc: Ruslan Kabatsayev <>
Cc: Thomas Gleixner <>
Link: default avatarIngo Molnar <>
parent d696ca01
......@@ -292,7 +292,7 @@ void vmalloc_sync_all(void)
for (address = VMALLOC_START & PMD_MASK;
address >= TASK_SIZE && address < FIXADDR_TOP;
address >= TASK_SIZE_MAX && address < FIXADDR_TOP;
address += PMD_SIZE) {
struct page *page;
......@@ -854,8 +854,13 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
/* Kernel addresses are always protection faults: */
if (address >= TASK_SIZE)
* To avoid leaking information about the kernel page table
* layout, pretend that user-mode accesses to kernel addresses
* are always protection faults.
if (address >= TASK_SIZE_MAX)
error_code |= PF_PROT;
if (likely(show_unhandled_signals))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment