[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <B8EF2379-0AF6-4D00-B6B8-214CA9073BFC@intel.com>
Date: Wed, 12 May 2021 18:48:11 +0000
From: "Bae, Chang Seok" <chang.seok.bae@...el.com>
To: Borislav Petkov <bp@...en8.de>
CC: Andy Lutomirski <luto@...nel.org>, "bp@...e.de" <bp@...e.de>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...nel.org" <mingo@...nel.org>,
"x86@...nel.org" <x86@...nel.org>,
"Brown, Len" <len.brown@...el.com>,
"Hansen, Dave" <dave.hansen@...el.com>,
"hjl.tools@...il.com" <hjl.tools@...il.com>,
"Dave.Martin@....com" <Dave.Martin@....com>,
"jannh@...gle.com" <jannh@...gle.com>,
"mpe@...erman.id.au" <mpe@...erman.id.au>,
"carlos@...hat.com" <carlos@...hat.com>,
"Luck, Tony" <tony.luck@...el.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
"libc-alpha@...rceware.org" <libc-alpha@...rceware.org>,
"linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 5/6] x86/signal: Detect and prevent an alternate signal
stack overflow
On May 11, 2021, at 11:36, Borislav Petkov <bp@...en8.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
Powered by blists - more mailing lists