All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH 1/1] sandbox: don't set SA_NODEFER in signal handler
Date: Wed, 7 Jul 2021 11:37:10 -0600	[thread overview]
Message-ID: <CAPnjgZ1B_9sz+g5Bw3sCHhodXPouY94DC=qggdq9ZY1B85-JYQ@mail.gmail.com> (raw)
In-Reply-To: <20210705174300.18792-1-xypron.glpk@gmx.de>

Hi Heinrich,

On Mon, 5 Jul 2021 at 11:43, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> The sandbox can handle signals. Due to a damaged global data pointer
> additional exceptions in the signal handler may occur leading to an endless
> loop. In this case leave the handling of the secondary exception to the
> operating system.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  arch/sandbox/cpu/os.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I'm OK with this since it doesn't actually matter, now that the
signal-catching behaviour is optional.

But as I understand it, it will mean that the second exception is
reported, but not the first? In other words, any core dump will be
'incorrect' in that it is not suitable for postmortem debugging.

>
> diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
> index 0d21827e1b..9a73ae3b18 100644
> --- a/arch/sandbox/cpu/os.c
> +++ b/arch/sandbox/cpu/os.c
> @@ -226,7 +226,7 @@ int os_setup_signal_handlers(void)
>
>         act.sa_sigaction = os_signal_handler;
>         sigemptyset(&act.sa_mask);
> -       act.sa_flags = SA_SIGINFO | SA_NODEFER;
> +       act.sa_flags = SA_SIGINFO;
>         if (sigaction(SIGILL, &act, NULL) ||
>             sigaction(SIGBUS, &act, NULL) ||
>             sigaction(SIGSEGV, &act, NULL))
> --
> 2.30.2
>

Regards,
Simon

  reply	other threads:[~2021-07-07 17:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 17:43 [PATCH 1/1] sandbox: don't set SA_NODEFER in signal handler Heinrich Schuchardt
2021-07-07 17:37 ` Simon Glass [this message]
2021-07-17 21:41   ` Simon Glass
2021-07-22  2:12   ` Simon Glass

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='CAPnjgZ1B_9sz+g5Bw3sCHhodXPouY94DC=qggdq9ZY1B85-JYQ@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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.