projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98f30b1
)
x86/mm/64: In vmalloc_fault(), use CR3 instead of current->active_mm
author
Andy Lutomirski
<
[email protected]
>
Thu, 14 Jul 2016 20:22:54 +0000
(13:22 -0700)
committer
Ingo Molnar
<
[email protected]
>
Fri, 15 Jul 2016 08:26:27 +0000
(10:26 +0200)
If we get a vmalloc fault while current->active_mm->pgd doesn't
match CR3, we'll crash without this change. I've seen this failure
mode on heavily instrumented kernels with virtually mapped stacks.
Signed-off-by: Andy Lutomirski <
[email protected]
>
Cc: Borislav Petkov <
[email protected]
>
Cc: Brian Gerst <
[email protected]
>
Cc: Denys Vlasenko <
[email protected]
>
Cc: H. Peter Anvin <
[email protected]
>
Cc: Josh Poimboeuf <
[email protected]
>
Cc: Linus Torvalds <
[email protected]
>
Cc: Peter Zijlstra <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Link:
http://lkml.kernel.org/r/4650d7674185f165ed8fdf9ac4c5c35c5c179ba8.1468527351.git.luto@kernel.org
Signed-off-by: Ingo Molnar <
[email protected]
>
arch/x86/mm/fault.c
patch
|
blob
|
history
diff --git
a/arch/x86/mm/fault.c
b/arch/x86/mm/fault.c
index 7d1fa7cd237443e054da06255697412d5e9354f6..ca44e2e7fd00f150c600b099d252531bd04c711b 100644
(file)
--- a/
arch/x86/mm/fault.c
+++ b/
arch/x86/mm/fault.c
@@
-439,7
+439,7
@@
static noinline int vmalloc_fault(unsigned long address)
* happen within a race in page table update. In the later
* case just flush:
*/
- pgd =
pgd_offset(current->active_mm,
address);
+ pgd =
(pgd_t *)__va(read_cr3()) + pgd_index(
address);
pgd_ref = pgd_offset_k(address);
if (pgd_none(*pgd_ref))
return -1;