Re: [PATCH] s390/mm: Fix in_atomic() handling in do_secure_storage_access()

Claudio Imbrenda
2025-06-04T17:40:57Z

On Wed, 4 Jun 2025 19:29:31 +0200
Alexander Gordeev <agordeev@linux.ibm.com> wrote:

> On Wed, Jun 04, 2025 at 06:48:55PM +0200, Claudio Imbrenda wrote:
> > > > @@ -441,6 +441,8 @@ void do_secure_storage_access(struct pt_regs *regs)
> > > > if (rc)
> > > > BUG();
> > > > } else {
> > > > + if (faulthandler_disabled())
> > > > + return handle_fault_error_nolock(regs, 0);
> > > >
> > >
> > > This could trigger WARN_ON_ONCE() in handle_fault_error_nolock():
> > >
> > > if (WARN_ON_ONCE(!si_code))
> > > si_code = SEGV_MAPERR;
> > >
> > > Would this warning be justified in this case (aka user_mode(regs) ==
> > > true)?
> >
> > I think so, because if we are in usermode, we should never trigger
> > faulthandler_disabled()
>
> I think I do not get you. We are in a system call and also in_atomic(),
> so faulthandler_disabled() is true and handle_fault_error_nolock(regs, 0)
> is called (above).

what is the psw in regs?
is it not the one that was being used when the exception was triggered?

>
> >
> > >
> > > > mm = current->mm;
> > > > mmap_read_lock(mm);
> > > > vma = find_vma(mm, addr);