[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210111181520.GE25645@zn.tnic>
Date: Mon, 11 Jan 2021 19:15:20 +0100
From: Borislav Petkov <bp@...en8.de>
To: "Chang S. Bae" <chang.seok.bae@...el.com>,
Andy Lutomirski <luto@...nel.org>
Cc: tdevries@...e.com, x86-ml <x86@...nel.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: gdbserver + fsgsbase kaputt
Hi,
so there's a breakage of a use case with gdbserver on fsgsbase machines,
see
https://sourceware.org/bugzilla/show_bug.cgi?id=26804
Tom has an even simpler reproducer:
$ cat test.c
int
main (void)
{
return 0;
}
$ gcc test.c -m32
$ gdbserver localhost:12345 a.out
... other terminal ...
$ gdb -batch -q -ex "target remote localhost:12345" -ex continue
Program received signal SIGSEGV, Segmentation fault.
0xf7dd8bd2 in init_cacheinfo () at ../sysdeps/x86/cacheinfo.c:761
The correct output is, of course:
...
[Inferior 1 (process 1860) exited normally]
I tried to bisect this but it led me to:
b745cfba44c1 ("x86/cpu: Enable FSGSBASE on 64bit by default and add a chicken bit")
which simply enables fsgsbase so I could've made a small mistake in the
bisection.
I say small because booting with "nofsgsbase" cures it so it must be
something fsgsbase + ptrace especially since the symptom is a corrupted
stack canary in %gs...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists