Skip to content

Commit 8fa5070

Browse files
FlyGoattsbogend
authored andcommitted
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: 4bce37a ("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]>
1 parent 9d6e21d commit 8fa5070

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
@@ -5478,7 +5478,7 @@ static inline bool get_mmap_lock_carefully(struct mm_struct *mm, struct pt_regs
54785478
return true;
54795479

54805480
if (regs && !user_mode(regs)) {
5481-
unsigned long ip = instruction_pointer(regs);
5481+
unsigned long ip = exception_ip(regs);
54825482
if (!search_exception_tables(ip))
54835483
return false;
54845484
}
@@ -5503,7 +5503,7 @@ static inline bool upgrade_mmap_lock_carefully(struct mm_struct *mm, struct pt_r
55035503
{
55045504
mmap_read_unlock(mm);
55055505
if (regs && !user_mode(regs)) {
5506-
unsigned long ip = instruction_pointer(regs);
5506+
unsigned long ip = exception_ip(regs);
55075507
if (!search_exception_tables(ip))
55085508
return false;
55095509
}

0 commit comments

Comments
 (0)