aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r--arch/x86/mm/fault.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 46df4c6aae46..58e4f1f00bbc 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -710,6 +710,10 @@ static void set_signal_archinfo(unsigned long address,
710 * To avoid leaking information about the kernel page 710 * To avoid leaking information about the kernel page
711 * table layout, pretend that user-mode accesses to 711 * table layout, pretend that user-mode accesses to
712 * kernel addresses are always protection faults. 712 * kernel addresses are always protection faults.
713 *
714 * NB: This means that failed vsyscalls with vsyscall=none
715 * will have the PROT bit. This doesn't leak any
716 * information and does not appear to cause any problems.
713 */ 717 */
714 if (address >= TASK_SIZE_MAX) 718 if (address >= TASK_SIZE_MAX)
715 error_code |= X86_PF_PROT; 719 error_code |= X86_PF_PROT;
@@ -1369,16 +1373,18 @@ void do_user_addr_fault(struct pt_regs *regs,
1369 1373
1370#ifdef CONFIG_X86_64 1374#ifdef CONFIG_X86_64
1371 /* 1375 /*
1372 * Instruction fetch faults in the vsyscall page might need 1376 * Faults in the vsyscall page might need emulation. The
1373 * emulation. The vsyscall page is at a high address 1377 * vsyscall page is at a high address (>PAGE_OFFSET), but is
1374 * (>PAGE_OFFSET), but is considered to be part of the user 1378 * considered to be part of the user address space.
1375 * address space.
1376 * 1379 *
1377 * The vsyscall page does not have a "real" VMA, so do this 1380 * The vsyscall page does not have a "real" VMA, so do this
1378 * emulation before we go searching for VMAs. 1381 * emulation before we go searching for VMAs.
1382 *
1383 * PKRU never rejects instruction fetches, so we don't need
1384 * to consider the PF_PK bit.
1379 */ 1385 */
1380 if ((hw_error_code & X86_PF_INSTR) && is_vsyscall_vaddr(address)) { 1386 if (is_vsyscall_vaddr(address)) {
1381 if (emulate_vsyscall(regs, address)) 1387 if (emulate_vsyscall(hw_error_code, regs, address))
1382 return; 1388 return;
1383 } 1389 }
1384#endif 1390#endif