mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 17:23:25 -05:00
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: Andreas Schwab <schwab@suse.de> [Palmer: Duplicated code instead of a goto] Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
a967a289f1
commit
8fef9900d4
1 changed files with 2 additions and 1 deletions
|
@ -229,8 +229,9 @@ vmalloc_fault:
|
||||||
pte_t *pte_k;
|
pte_t *pte_k;
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
|
/* User mode accesses just cause a SIGSEGV */
|
||||||
if (user_mode(regs))
|
if (user_mode(regs))
|
||||||
goto bad_area;
|
return do_trap(regs, SIGSEGV, code, addr, tsk);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Synchronize this task's top level page-table
|
* Synchronize this task's top level page-table
|
||||||
|
|
Loading…
Add table
Reference in a new issue