diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-11-04 18:46:21 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-11-10 04:43:13 -0500 |
commit | 07114f0f1cda8b2ef6e884d0c7b268a32cce7903 (patch) | |
tree | d5a4cdabfea6290b9b2f77515c4dc4c3b50d301a | |
parent | 1ad83c858c7d4ea210429142c99a1548e6715a35 (diff) |
x86_64: Add a comment explaining the TASK_SIZE_MAX guard page
That guard page is absolutely necessary; explain why for
posterity.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Link: http://lkml.kernel.org/r/23320cb5017c2da8475ec20fcde8089d82aa2699.1415144745.git.luto@amacapital.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/processor.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index eb71ec794732..82d93ea13c0c 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -893,7 +893,13 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
893 | 893 | ||
894 | #else | 894 | #else |
895 | /* | 895 | /* |
896 | * User space process size. 47bits minus one guard page. | 896 | * User space process size. 47bits minus one guard page. The guard |
897 | * page is necessary on Intel CPUs: if a SYSCALL instruction is at | ||
898 | * the highest possible canonical userspace address, then that | ||
899 | * syscall will enter the kernel with a non-canonical return | ||
900 | * address, and SYSRET will explode dangerously. We avoid this | ||
901 | * particular problem by preventing anything from being mapped | ||
902 | * at the maximum canonical address. | ||
897 | */ | 903 | */ |
898 | #define TASK_SIZE_MAX ((1UL << 47) - PAGE_SIZE) | 904 | #define TASK_SIZE_MAX ((1UL << 47) - PAGE_SIZE) |
899 | 905 | ||