Skip to content

Commit af2ebdc

Browse files
amlutoIngo Molnar
authored andcommitted
x86/vsyscall/64: Use X86_PF constants in the simulated #PF error code
Rather than hardcoding 6 with a comment, use the defined constants. Signed-off-by: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Yu-cheng Yu <[email protected]> Link: http://lkml.kernel.org/r/e023f20352b0d05a8b0205629897917262d2ad68.1542841400.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent d38bc89 commit af2ebdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/entry/vsyscall/vsyscall_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static bool write_ok_or_segv(unsigned long ptr, size_t size)
102102
if (!access_ok(VERIFY_WRITE, (void __user *)ptr, size)) {
103103
struct thread_struct *thread = &current->thread;
104104

105-
thread->error_code = 6; /* user fault, no page, write */
105+
thread->error_code = X86_PF_USER | X86_PF_WRITE;
106106
thread->cr2 = ptr;
107107
thread->trap_nr = X86_TRAP_PF;
108108

0 commit comments

Comments
 (0)