Re: Strange EFAULT on mips64el returned by syscall when another thread is forking

From: Xi Ruoyao
Date: Fri Jan 26 2024 - 13:01:06 EST


On Fri, 2024-01-26 at 20:58 +0800, Xi Ruoyao wrote:
> On Fri, 2024-01-26 at 12:33 +0000, Jiaxun Yang wrote:
> >
> >
> > 在2024年1月24日一月 上午10:42,Xi Ruoyao写道:
> > > Hi,
> > >
> > > When I'm testing Glibc master branch for upcoming 2.39 release, I
> > > noticed an alarming test failure on mips64el:
> >
> > So apparently it should be tracked as a regression.
> >
> > #regzbot ^introduced 4bce37a68ff884e821a02a731897a8119e0c37b7
> >
> > Should we revert it for now?
>
> I'd say "yes" if we cannot easily patch instruction_pointer() to handle
> delay slot.  Anyway the reversion will be a MIPS-only change.

Phew. Just tried it and:

arch/mips/mm/fault.c: In function ‘__do_page_fault’:
arch/mips/mm/fault.c:111:26: error: passing argument 1 of ‘expand_stack’ from incompatible pointer type [-Werror=incompatible-pointer-types]
111 | if (expand_stack(vma, address))
| ^~~
| |
| struct vm_area_struct *
In file included from ./include/linux/pid_namespace.h:7,
from ./include/linux/ptrace.h:10,
from arch/mips/mm/fault.c:16:
/include/linux/mm.h:3431:56: note: expected ‘struct mm_struct *’ but argument is of type ‘struct vm_area_struct *’
3431 | struct vm_area_struct *expand_stack(struct mm_struct * mm, unsigned long addr);
| ~~~~~~~~~~~~~~~~~~~^~
cc1: some warnings being treated as errors

--
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University