Commit 8fef9900 authored by Andreas Schwab's avatar Andreas Schwab Committed by Palmer Dabbelt

riscv: fix locking violation in page fault handler

When a user mode process accesses an address in the vmalloc area
do_page_fault tries to unlock the mmap semaphore when it isn't locked.
Signed-off-by: default avatarAndreas Schwab <schwab@suse.de>
[Palmer: Duplicated code instead of a goto]
Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
parent a967a289
......@@ -229,8 +229,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
pte_t *pte_k;
int index;
/* User mode accesses just cause a SIGSEGV */
if (user_mode(regs))
goto bad_area;
return do_trap(regs, SIGSEGV, code, addr, tsk);
/*
* Synchronize this task's top level page-table
......
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