[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87pmxv65av.ffs@nanos.tec.linutronix.de>
Date: Wed, 12 May 2021 22:55:04 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: "Bae\, Chang Seok" <chang.seok.bae@...el.com>,
Borislav Petkov <bp@...en8.de>
Cc: Andy Lutomirski <luto@...nel.org>, "bp\@suse.de" <bp@...e.de>,
"mingo\@kernel.org" <mingo@...nel.org>,
"x86\@kernel.org" <x86@...nel.org>,
"Brown\, Len" <len.brown@...el.com>,
"Hansen\, Dave" <dave.hansen@...el.com>,
"hjl.tools\@gmail.com" <hjl.tools@...il.com>,
"Dave.Martin\@arm.com" <Dave.Martin@....com>,
"jannh\@google.com" <jannh@...gle.com>,
"mpe\@ellerman.id.au" <mpe@...erman.id.au>,
"carlos\@redhat.com" <carlos@...hat.com>,
"Luck\, Tony" <tony.luck@...el.com>,
"Shankar\, Ravi V" <ravi.v.shankar@...el.com>,
"libc-alpha\@sourceware.org" <libc-alpha@...rceware.org>,
"linux-arch\@vger.kernel.org" <linux-arch@...r.kernel.org>,
"linux-api\@vger.kernel.org" <linux-api@...r.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 5/6] x86/signal: Detect and prevent an alternate signal stack overflow
On Wed, May 12 2021 at 18:48, Chang Seok Bae wrote:
> 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.
That's the intended usage, but it's not limited to that and there exists
creative (ab)use of sigaltstack beyond catching the overflow of the
regular stack.
Thanks,
tglx
Powered by blists - more mailing lists