aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiaxun Yang <[email protected]>2024-02-02 12:30:28 +0000
committerThomas Bogendoerfer <[email protected]>2024-02-12 23:04:42 +0100
commit8fa5070833886268e4fb646daaca99f725b378e9 (patch)
tree5d391de742ad041dbf2f46b87762dd15566d7349
parent9d6e21ddf20293b3880ae55b9d14de91c5891c59 (diff)
mm/memory: Use exception ip to search exception tables
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]>
-rw-r--r--mm/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 89bcae0b224d..15f8b10ea17c 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -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;
}