public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
	Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/mm: Fix in_atomic() handling in do_secure_storage_access()
Date: Thu, 5 Jun 2025 11:06:29 +0200	[thread overview]
Message-ID: <408922a2-ec1a-4e60-841a-90714a3310de@linux.ibm.com> (raw)
In-Reply-To: <aEFdoYSKqvqK572c@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>

Am 05.06.25 um 11:04 schrieb Alexander Gordeev:
> On Wed, Jun 04, 2025 at 07:40:43PM +0200, Claudio Imbrenda wrote:
>>>>> 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?
> 
> Hmm, right. I assume is_kernel_fault() returns false not because
> user_mode(regs) is true, but because we access the secondary AS.
> 
> Still, to me it feels wrong to trigger that warning due to a user
> process activity. But anyway:
> 
> Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>

Can we trigger a WARN from userspace?

  reply	other threads:[~2025-06-05  9:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 13:49 [PATCH] s390/mm: Fix in_atomic() handling in do_secure_storage_access() Heiko Carstens
2025-06-04 12:16 ` Claudio Imbrenda
2025-06-04 16:27 ` Alexander Gordeev
2025-06-04 16:48   ` Claudio Imbrenda
2025-06-04 17:29     ` Alexander Gordeev
2025-06-04 17:40       ` Claudio Imbrenda
2025-06-05  9:04         ` Alexander Gordeev
2025-06-05  9:06           ` Christian Borntraeger [this message]
2025-06-05 10:07             ` Heiko Carstens
2025-06-05 10:21               ` Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=408922a2-ec1a-4e60-841a-90714a3310de@linux.ibm.com \
    --to=borntraeger@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox