Skip to content

Commit c72eda0

Browse files
FlyGoatgregkh
authored andcommitted
mm/memory: Use exception ip to search exception tables
commit 8fa5070833886268e4fb646daaca99f725b378e9 upstream. 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]> Cc: Salvatore Bonaccorso <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7b425f5 commit c72eda0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5323,7 +5323,7 @@ static inline bool get_mmap_lock_carefully(struct mm_struct *mm, struct pt_regs
53235323
}
53245324

53255325
if (regs && !user_mode(regs)) {
5326-
unsigned long ip = instruction_pointer(regs);
5326+
unsigned long ip = exception_ip(regs);
53275327
if (!search_exception_tables(ip))
53285328
return false;
53295329
}
@@ -5348,7 +5348,7 @@ static inline bool upgrade_mmap_lock_carefully(struct mm_struct *mm, struct pt_r
53485348
{
53495349
mmap_read_unlock(mm);
53505350
if (regs && !user_mode(regs)) {
5351-
unsigned long ip = instruction_pointer(regs);
5351+
unsigned long ip = exception_ip(regs);
53525352
if (!search_exception_tables(ip))
53535353
return false;
53545354
}

0 commit comments

Comments
 (0)