Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Kyle Huey
On Tue, Aug 25, 2020 at 12:32 PM Andy Lutomirski wrote: > > On Tue, Aug 25, 2020 at 11:50 AM Kyle Huey wrote: > > > > On Tue, Aug 25, 2020 at 10:31 AM Kyle Huey wrote: > > > > > > On Tue, Aug 25, 2020 at 9:46 AM Andy Lutomirski wrote: > > > > > > > > On Tue, Aug 25, 2020 at 9:32 AM Kyle Huey

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Andy Lutomirski
On Tue, Aug 25, 2020 at 11:50 AM Kyle Huey wrote: > > On Tue, Aug 25, 2020 at 10:31 AM Kyle Huey wrote: > > > > On Tue, Aug 25, 2020 at 9:46 AM Andy Lutomirski wrote: > > > > > > On Tue, Aug 25, 2020 at 9:32 AM Kyle Huey wrote: > > > > > > > > On Tue, Aug 25, 2020 at 9:12 AM Andy Lutomirski

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Kyle Huey
On Tue, Aug 25, 2020 at 10:31 AM Kyle Huey wrote: > > On Tue, Aug 25, 2020 at 9:46 AM Andy Lutomirski wrote: > > > > On Tue, Aug 25, 2020 at 9:32 AM Kyle Huey wrote: > > > > > > On Tue, Aug 25, 2020 at 9:12 AM Andy Lutomirski > > > wrote: > > > > I don’t like this at all. Your behavior really

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Kyle Huey
On Tue, Aug 25, 2020 at 9:46 AM Andy Lutomirski wrote: > > On Tue, Aug 25, 2020 at 9:32 AM Kyle Huey wrote: > > > > On Tue, Aug 25, 2020 at 9:12 AM Andy Lutomirski wrote: > > > I don’t like this at all. Your behavior really shouldn’t depend on > > > whether the new instructions are available.

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Andy Lutomirski
On Tue, Aug 25, 2020 at 9:32 AM Kyle Huey wrote: > > On Tue, Aug 25, 2020 at 9:12 AM Andy Lutomirski wrote: > > I don’t like this at all. Your behavior really shouldn’t depend on > > whether the new instructions are available. Also, some day I would > > like to change Linux to have the new

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Kyle Huey
On Tue, Aug 25, 2020 at 9:12 AM Andy Lutomirski wrote: > I don’t like this at all. Your behavior really shouldn’t depend on > whether the new instructions are available. Also, some day I would > like to change Linux to have the new behavior even if FSGSBASE > instructions are not available, and

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread Andy Lutomirski
> On Aug 24, 2020, at 5:46 PM, Kyle Huey wrote: > > On Mon, Aug 24, 2020 at 5:31 PM Andy Lutomirski wrote: >> >>> On Mon, Aug 24, 2020 at 4:52 PM H. Peter Anvin wrote: >>> >>> On 2020-08-24 14:10, Andy Lutomirski wrote: PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor.

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-25 Thread hpa
On August 24, 2020 5:30:56 PM PDT, Andy Lutomirski wrote: >On Mon, Aug 24, 2020 at 4:52 PM H. Peter Anvin wrote: >> >> On 2020-08-24 14:10, Andy Lutomirski wrote: >> > >> > PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor. >> > >> > PTRACE_SET_FS / PTRACE_SET_GS: Sets FS or GS and

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-24 Thread Kyle Huey
On Mon, Aug 24, 2020 at 5:31 PM Andy Lutomirski wrote: > > On Mon, Aug 24, 2020 at 4:52 PM H. Peter Anvin wrote: > > > > On 2020-08-24 14:10, Andy Lutomirski wrote: > > > > > > PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor. > > > > > > PTRACE_SET_FS / PTRACE_SET_GS: Sets FS or GS

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-24 Thread Andy Lutomirski
On Mon, Aug 24, 2020 at 4:52 PM H. Peter Anvin wrote: > > On 2020-08-24 14:10, Andy Lutomirski wrote: > > > > PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor. > > > > PTRACE_SET_FS / PTRACE_SET_GS: Sets FS or GS and updates the base > > accordingly. > > > > PTRACE_READ_SEGMENT_BASE:

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-24 Thread H. Peter Anvin
On 2020-08-24 14:10, Andy Lutomirski wrote: > > PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor. > > PTRACE_SET_FS / PTRACE_SET_GS: Sets FS or GS and updates the base accordingly. > > PTRACE_READ_SEGMENT_BASE: pass in a segment selector, get a base out. > You would use this to

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-24 Thread Andy Lutomirski
On Sat, Aug 22, 2020 at 6:19 AM Andy Lutomirski wrote: > > We can give you a new ptrace operation to load the selector and deduce the > base from the descriptor table if it would help. Concretely, we could add one of these: PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor.

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-21 Thread Kyle Huey
On Fri, Aug 21, 2020 at 7:53 PM Andy Lutomirski wrote: > > > > > On Aug 21, 2020, at 2:33 PM, Kyle Huey wrote: > > > > On Fri, Aug 21, 2020 at 1:08 PM Bae, Chang Seok > > wrote: > >> > >> > On Aug 20, 2020, at 21:41, Kyle Huey wrote: > >>> > >>> On the x86-64 5.9-rc1 TLS is completely

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-21 Thread Andy Lutomirski
> On Aug 21, 2020, at 2:33 PM, Kyle Huey wrote: > > On Fri, Aug 21, 2020 at 1:08 PM Bae, Chang Seok > wrote: >> >> On Aug 20, 2020, at 21:41, Kyle Huey wrote: >>> >>> On the x86-64 5.9-rc1 TLS is completely broken in 32 bit tracees when >>> running under rr[0]. Booting the kernel

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-21 Thread Bae, Chang Seok
> On Aug 21, 2020, at 14:32, Kyle Huey wrote: > > 40c45904f818c1f6555294ca27afc5fda4f09e68 added magic for a 32 bit > tracer tracing a 32 bit tracee on a 64 bit kernel, but it looks like a > 64 bit tracer tracing a 32 bit tracee on a 64 bit kernel *is* now > expected to preserve the fs/gsbase

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-21 Thread Kyle Huey
On Fri, Aug 21, 2020 at 1:08 PM Bae, Chang Seok wrote: > > > > On Aug 20, 2020, at 21:41, Kyle Huey wrote: > > > > 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 > >

Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-21 Thread Bae, Chang Seok
> On Aug 20, 2020, at 21:41, Kyle Huey wrote: > > 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 >

[REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system

2020-08-20 Thread Kyle Huey
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=673903495c85137791d5820d690229efe09c8f7b. STR: 1. Build rr