mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
mm/memory: Use exception ip to search exception tables
[ Upstream commit8fa5070833
] 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:4bce37a68f
("mips/mm: Convert to using lock_mm_and_find_vma()") Reported-by: Xi Ruoyao <xry111@xry111.site> Link: https://lore.kernel.org/r/75e9fd7b08562ad9b456a5bdaacb7cc220311cc9.camel@xry111.site/ Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
94691bddb3
commit
c3a7dbff8d
1 changed files with 2 additions and 2 deletions
|
@ -5373,7 +5373,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;
|
||||
}
|
||||
|
@ -5398,7 +5398,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue