unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Bae, Chang Seok via Libc-alpha" <libc-alpha@sourceware.org>
To: Borislav Petkov <bp@alien8.de>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	"Brown, Len" <len.brown@intel.com>,
	"Luck, Tony" <tony.luck@intel.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	"jannh@google.com" <jannh@google.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Dave.Martin@arm.com" <Dave.Martin@arm.com>,
	"Hansen, Dave" <dave.hansen@intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"bp@suse.de" <bp@suse.de>, "mingo@kernel.org" <mingo@kernel.org>,
	"Shankar, Ravi V" <ravi.v.shankar@intel.com>
Subject: Re: [PATCH v8 5/6] x86/signal: Detect and prevent an alternate signal stack overflow
Date: Wed, 12 May 2021 18:48:11 +0000	[thread overview]
Message-ID: <B8EF2379-0AF6-4D00-B6B8-214CA9073BFC@intel.com> (raw)
In-Reply-To: <YJrOsbyYhMndI5jd@zn.tnic>

On May 11, 2021, at 11:36, Borislav Petkov <bp@alien8.de> wrote:
> 
> I clumsily tried to register a SIGSEGV handler with
> 
>        act.sa_sigaction = my_sigsegv;
>        sigaction(SIGSEGV, &act, NULL);
> 
> but that doesn't fire - task gets killed. Maybe I'm doing it wrong.

Since the altstack is already overflowed, perhaps set the flag like this -- not
using it to get the handler:

	act.sa_sigaction = my_sigsegv;
+	act.sa_flags = SA_SIGINFO;
	sigaction(SIGSEGV, &act, NULL);

FWIW, I think this is just a workaround for this case; in practice, altstack is
rather a backup for normal stack corruption.

Thanks,
Chang


  reply	other threads:[~2021-05-12 18:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22  4:48 [PATCH v8 0/6] Improve Minimum Alternate Stack Size Chang S. Bae via Libc-alpha
2021-04-22  4:48 ` [PATCH v8 1/6] uapi: Define the aux vector AT_MINSIGSTKSZ Chang S. Bae via Libc-alpha
2021-04-22  4:48 ` [PATCH v8 2/6] x86/signal: Introduce helpers to get the maximum signal frame size Chang S. Bae via Libc-alpha
2021-05-03 13:06   ` Borislav Petkov via Libc-alpha
2021-04-22  4:48 ` [PATCH v8 3/6] x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ Chang S. Bae via Libc-alpha
2021-04-22  4:48 ` [PATCH v8 4/6] selftest/sigaltstack: Use the AT_MINSIGSTKSZ aux vector if available Chang S. Bae via Libc-alpha
2021-04-22  4:48 ` [PATCH v8 5/6] x86/signal: Detect and prevent an alternate signal stack overflow Chang S. Bae via Libc-alpha
2021-04-22  8:46   ` David Laight via Libc-alpha
2021-04-22 16:31     ` Bae, Chang Seok via Libc-alpha
2021-04-22 22:04       ` David Laight via Libc-alpha
2021-05-18 20:53         ` Bae, Chang Seok via Libc-alpha
2021-05-11 18:36   ` Borislav Petkov via Libc-alpha
2021-05-12 18:48     ` Bae, Chang Seok via Libc-alpha [this message]
2021-05-12 20:55       ` Thomas Gleixner via Libc-alpha
2021-05-14  7:26         ` Borislav Petkov via Libc-alpha
2021-04-22  4:48 ` [PATCH v8 6/6] selftest/x86/signal: Include test cases for validating sigaltstack Chang S. Bae via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=B8EF2379-0AF6-4D00-B6B8-214CA9073BFC@intel.com \
    --to=libc-alpha@sourceware.org \
    --cc=Dave.Martin@arm.com \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=jannh@google.com \
    --cc=len.brown@intel.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=ravi.v.shankar@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).