linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system
@ 2020-08-21  4:41 Kyle Huey
  2020-08-21 20:08 ` Bae, Chang Seok
  0 siblings, 1 reply; 18+ messages in thread
From: Kyle Huey @ 2020-08-21  4:41 UTC (permalink / raw)
  To: Andy Lutomirski, Chang S. Bae, Thomas Gleixner, Ingo Molnar,
	H . Peter Anvin, Andi Kleen
  Cc: Robert O'Callahan, Ravi Shankar, LKML

On the x86-64 5.9-rc1 TLS is completely broken in 32 bit tracees when
running under rr[0]. Booting the kernel with `nofsgsbase` fixes it and
I bisected to https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v5.8&id=673903495c85137791d5820d690229efe09c8f7b.

STR:
1. Build rr from source by
  a. git clone https://github.com/mozilla/rr
  b. mkdir rr/obj
  c. cd rr/obj
  d. cmake ..
  e. make -j16
2. Run the simple 32 bit tracee outside of rr with `./bin/simple_32`.
It should print a message and exit cleanly.
3. Run it under rr with `./bin/rr ./bin/simple_32`.

It should behave the same way, but with fsgsbase enabled it will
segfault. The `simple_32` binary is a simple "hello world" type
program but it does link to pthreads, so pre-main code attempts to
access TLS variables.

The interplay between 32 bit and 64 bit TLS is dark magic to me
unfortunately so this is all the useful information I have.

- Kyle

[0] https://rr-project.org/

^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <CAOp6jLYrwMqV=7hmxgdZUdDZ2aeUB27TTHm=j6cQT7C10Muhww@mail.gmail.com>]

end of thread, other threads:[~2020-08-25 20:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21  4:41 [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system Kyle Huey
2020-08-21 20:08 ` Bae, Chang Seok
2020-08-21 21:32   ` Kyle Huey
2020-08-21 21:46     ` Bae, Chang Seok
2020-08-22  2:53     ` Andy Lutomirski
2020-08-22  3:03       ` Kyle Huey
     [not found] <CAOp6jLYrwMqV=7hmxgdZUdDZ2aeUB27TTHm=j6cQT7C10Muhww@mail.gmail.com>
     [not found] ` <7DF88F22-0310-40C9-9DA6-5EBCB4877933@amacapital.net>
2020-08-24 21:10   ` Andy Lutomirski
2020-08-24 23:52     ` H. Peter Anvin
2020-08-25  0:30       ` Andy Lutomirski
2020-08-25  0:46         ` Kyle Huey
2020-08-25 16:12           ` Andy Lutomirski
2020-08-25 16:32             ` Kyle Huey
2020-08-25 16:46               ` Andy Lutomirski
2020-08-25 17:31                 ` Kyle Huey
2020-08-25 18:50                   ` Kyle Huey
2020-08-25 19:32                     ` Andy Lutomirski
2020-08-25 20:03                       ` Kyle Huey
2020-08-25 15:13         ` hpa

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 NNTP newsgroup(s).