From: Hajime Tazaki <thehajime@gmail.com>
To: linux-um@lists.infradead.org
Cc: ricarkol@google.com, Liam.Howlett@oracle.com
Subject: Re: [PATCH v4 10/13] x86/um: nommu: signal handling
Date: Thu, 12 Dec 2024 11:00:43 +0900 [thread overview]
Message-ID: <m234it7j90.wl-thehajime@gmail.com> (raw)
In-Reply-To: <aa935a0f32fec0ff4073fb004eab4b22f80ac750.1733652929.git.thehajime@gmail.com>
On Sun, 08 Dec 2024 19:15:37 +0900,
Hajime Tazaki wrote:
>
> This commit updates the behavior of signal handling under !MMU
> environment. 1) the stack preparation for the signal handlers and
> 2) restoration of stack after rt_sigreturn(2) syscall. Those are needed
> as the stack usage on vfork(2) syscall is different.
>
> It also adds the follow up routine for SIGSEGV as a signal delivery runs
> in the same stack frame while we have to avoid endless SIGSEGV.
(snip)
> diff --git a/arch/x86/um/nommu/signal.c b/arch/x86/um/nommu/signal.c
> new file mode 100644
> index 000000000000..a94e9b86273a
> --- /dev/null
> +++ b/arch/x86/um/nommu/signal.c
> @@ -0,0 +1,43 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include <linux/syscalls.h>
> +#include <linux/kernel.h>
> +#include <asm/sigframe.h>
> +
> +#include <sysdep/signal.h>
> +
> +int arch_setup_signal_stack_si(struct rt_sigframe __user **frame,
> + struct ksignal *ksig)
> +{
> + int err = 0;
> +
> + /*
> + * we need to push handler address at top of stack, as
> + * __kernel_vsyscall, called after this returns with ret with
> + * stack contents, thus push the handler here.
> + */
> + *frame = (struct rt_sigframe __user *) ((unsigned long) *frame -
> + sizeof(unsigned long));
> + err |= __put_user((unsigned long)ksig->ka.sa.sa_handler,
> + (unsigned long *)*frame);
> +
> + return err;
this has a serious issue to handle signals.
I also found that manipulation of stack pointer makes the code
cryptic..
I will clean up those parts in the next version.
-- Hajime
next prev parent reply other threads:[~2024-12-12 2:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-08 10:15 [PATCH v4 00/13] nommu UML Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 01/13] x86/um: clean up elf specific definitions Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 02/13] x86/um: nommu: elf loader for fdpic Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 03/13] um: decouple MMU specific code from the common part Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 04/13] um: nommu: memory handling Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 05/13] x86/um: nommu: syscall handling Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 06/13] um: nommu: seccomp syscalls hook Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 07/13] x86/um: nommu: process/thread handling Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 08/13] um: nommu: configure fs register on host syscall invocation Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 09/13] x86/um/vdso: nommu: vdso memory update Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 10/13] x86/um: nommu: signal handling Hajime Tazaki
2024-12-12 2:00 ` Hajime Tazaki [this message]
2024-12-08 10:15 ` [PATCH v4 11/13] um: change machine name for uname output Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 12/13] um: nommu: add documentation of nommu UML Hajime Tazaki
2024-12-08 10:15 ` [PATCH v4 13/13] um: nommu: plug nommu code into build system Hajime Tazaki
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=m234it7j90.wl-thehajime@gmail.com \
--to=thehajime@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=linux-um@lists.infradead.org \
--cc=ricarkol@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.