mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
arch/mips/kernel/traps: use vma_lookup() instead of find_vma()
Use vma_lookup() to find the VMA at a specific address. As vma_lookup() will return NULL if the address is not within any VMA, the start address no longer needs to be validated. Link: https://lkml.kernel.org/r/20210521174745.2219620-8-Liam.Howlett@Oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Reviewed-by: Laurent Dufour <ldufour@linux.ibm.com> Acked-by: David Hildenbrand <david@redhat.com> Acked-by: Davidlohr Bueso <dbueso@suse.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
900c83f88a
commit
7f7020ac0d
1 changed files with 1 additions and 3 deletions
|
@ -784,7 +784,6 @@ void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr,
|
||||||
int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31)
|
int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31)
|
||||||
{
|
{
|
||||||
int si_code;
|
int si_code;
|
||||||
struct vm_area_struct *vma;
|
|
||||||
|
|
||||||
switch (sig) {
|
switch (sig) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -800,8 +799,7 @@ int process_fpemu_return(int sig, void __user *fault_addr, unsigned long fcr31)
|
||||||
|
|
||||||
case SIGSEGV:
|
case SIGSEGV:
|
||||||
mmap_read_lock(current->mm);
|
mmap_read_lock(current->mm);
|
||||||
vma = find_vma(current->mm, (unsigned long)fault_addr);
|
if (vma_lookup(current->mm, (unsigned long)fault_addr))
|
||||||
if (vma && (vma->vm_start <= (unsigned long)fault_addr))
|
|
||||||
si_code = SEGV_ACCERR;
|
si_code = SEGV_ACCERR;
|
||||||
else
|
else
|
||||||
si_code = SEGV_MAPERR;
|
si_code = SEGV_MAPERR;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue