]> Git Repo - linux.git/commitdiff
mm/memory: Use exception ip to search exception tables
authorJiaxun Yang <[email protected]>
Fri, 2 Feb 2024 12:30:28 +0000 (12:30 +0000)
committerThomas Bogendoerfer <[email protected]>
Mon, 12 Feb 2024 22:04:42 +0000 (23:04 +0100)
On architectures with delay slot, instruction_pointer() may differ
from where exception was triggered.

Use exception_ip we just introduced to search exception tables to
get rid of the problem.

Fixes: 4bce37a68ff8 ("mips/mm: Convert to using lock_mm_and_find_vma()")
Reported-by: Xi Ruoyao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]/
Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Thomas Bogendoerfer <[email protected]>
mm/memory.c

index 89bcae0b224d6d43b4720c5c71a6c528e683bafb..15f8b10ea17c4f28e857009372f50bfd774001b9 100644 (file)
@@ -5478,7 +5478,7 @@ static inline bool get_mmap_lock_carefully(struct mm_struct *mm, struct pt_regs
                return true;
 
        if (regs && !user_mode(regs)) {
-               unsigned long ip = instruction_pointer(regs);
+               unsigned long ip = exception_ip(regs);
                if (!search_exception_tables(ip))
                        return false;
        }
@@ -5503,7 +5503,7 @@ static inline bool upgrade_mmap_lock_carefully(struct mm_struct *mm, struct pt_r
 {
        mmap_read_unlock(mm);
        if (regs && !user_mode(regs)) {
-               unsigned long ip = instruction_pointer(regs);
+               unsigned long ip = exception_ip(regs);
                if (!search_exception_tables(ip))
                        return false;
        }
This page took 0.069623 seconds and 4 git commands to generate.