From: Christian Borntraeger <borntraeger@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
Claudio Imbrenda <imbrenda@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 12:21:53 +0200 [thread overview]
Message-ID: <2dfdc293-beef-4a67-8173-00697d1fcc8c@linux.ibm.com> (raw)
In-Reply-To: <20250605100743.7808A03-hca@linux.ibm.com>
Am 05.06.25 um 12:07 schrieb Heiko Carstens:
> On Thu, Jun 05, 2025 at 11:06:29AM +0200, Christian Borntraeger wrote:
>> 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?
>
> No. If the warning triggers, then this indicates a bug in the kernel (exit to
> user with faulthandler_disabled() == true). I managed to screw up the kernel
> exactly with such a bug. See commit 588a9836a4ef ("s390/stacktrace: Use break
> instead of return statement"), which lead to random unexplainable user space
> crashes.
Ok, then this makes a lot of sense to WARN.
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
prev parent reply other threads:[~2025-06-05 10:22 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
2025-06-05 10:07 ` Heiko Carstens
2025-06-05 10:21 ` Christian Borntraeger [this message]
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=2dfdc293-beef-4a67-8173-00697d1fcc8c@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