From: Michael Schmitz <schmitzmic@gmail.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
linux-m68k@vger.kernel.org
Cc: geert@linux-m68k.org, uli@fpond.eu, fthain@linux-m68k.org,
viro@zeniv.linux.org.uk
Subject: Re: [PATCH RFC 4/4] m68k equivalent of 26178ec11ef3 "x86: mm: consolidate VM_FAULT_RETRY handling" If e.g. get_user() triggers a page fault and a fatal signal is caught, we might end up with handle_mm_fault() returning VM_FAULT_RETRY and not doing anything to page tables. In such case we must *not* return to the faulting insn - that would repeat the entire thing without making any progress; what we need instead is to treat that as failed (user) memory access.
Date: Mon, 5 Feb 2024 19:03:51 +1300 [thread overview]
Message-ID: <721d2b41-c9ac-7771-3e74-235cccd26fb4@gmail.com> (raw)
In-Reply-To: <87ad7f18a772614df4d36595d385b51e54c949d0.camel@physik.fu-berlin.de>
Hi Adrian,
Am 05.02.2024 um 18:32 schrieb John Paul Adrian Glaubitz:
> Hi Michael,
>
> On Mon, 2024-02-05 at 08:21 +1300, Michael Schmitz wrote:
>> From: Al Viro <viro@zeniv.linux.org.uk>
>>
>> MSch: v4.4 backport compile errors fixes.
>>
>> Tested-by: Finn Thain <fthain@linux-m68k.org>
>> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
>> ---
>> arch/m68k/mm/fault.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
>> index 6a94cdd0c830..f94df64c3784 100644
>> --- a/arch/m68k/mm/fault.c
>> +++ b/arch/m68k/mm/fault.c
>> @@ -139,8 +139,11 @@ good_area:
>> fault = handle_mm_fault(mm, vma, address, flags);
>> pr_debug("handle_mm_fault returns %d\n", fault);
>>
>> - if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
>> + if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) {
>> + if (!user_mode(regs))
>> + goto no_context;
>> return 0;
>> + }
>>
>> if (unlikely(fault & VM_FAULT_ERROR)) {
>> if (fault & VM_FAULT_OOM)
>
> That subject looks like it contains the long description which should go
> into the patch instead.
Yep - I fat-fingered editing the commit message there. Thanks for spotting!
Fixed in v2.
Michael
>
> Adrian
>
next prev parent reply other threads:[~2024-02-05 6:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 19:21 [PATCH RFC 0/4] Michael Schmitz
2024-02-04 19:21 ` [PATCH RFC 1/4] m68k: Handle arrivals of multiple signals correctly Michael Schmitz
2024-02-04 19:21 ` [PATCH RFC 2/4] m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal Michael Schmitz
2024-02-04 19:21 ` [PATCH RFC 3/4] m68k: Leave stack mangling to asm wrapper of sigreturn() Michael Schmitz
2024-02-04 19:21 ` [PATCH RFC 4/4] m68k equivalent of 26178ec11ef3 "x86: mm: consolidate VM_FAULT_RETRY handling" If e.g. get_user() triggers a page fault and a fatal signal is caught, we might end up with handle_mm_fault() returning VM_FAULT_RETRY and not doing anything to page tables. In such case we must *not* return to the faulting insn - that would repeat the entire thing without making any progress; what we need instead is to treat that as failed (user) memory access Michael Schmitz
2024-02-05 5:32 ` John Paul Adrian Glaubitz
2024-02-05 6:03 ` Michael Schmitz [this message]
2024-02-04 19:42 ` [PATCH RFC 0/4] Michael Schmitz
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=721d2b41-c9ac-7771-3e74-235cccd26fb4@gmail.com \
--to=schmitzmic@gmail.com \
--cc=fthain@linux-m68k.org \
--cc=geert@linux-m68k.org \
--cc=glaubitz@physik.fu-berlin.de \
--cc=linux-m68k@vger.kernel.org \
--cc=uli@fpond.eu \
--cc=viro@zeniv.linux.org.uk \
/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