[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BD1E061.8030605@zytor.com>
Date: Fri, 23 Apr 2010 11:01:05 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Samuel Thibault <samuel.thibault@...ri.fr>,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
olivier.aumage@...ia.fr, yannick.martin@...ia.fr
Subject: Re: X86_64 BUG: missing FS/GS LDT reload on fork()
On 04/23/2010 10:04 AM, Samuel Thibault wrote:
> Hello,
>
> I have an issue with FS/GS LDT reload in the child of fork(). The
> attached testcase fails quite often. It sets an LDT entry up, uses
> prctl to set gs's base to a 64bit value, then loads gs with the LDT
> entry. The LDT entry is now in effect. After a fork call, the LDT entry
> is not in effect any more, the 64bit base is back!
>
Okay... I have to say that I'm more than a bit confused why you're doing
this, but the __switch_no code in process_64.c has the following:
/*
* Check if the user used a selector != 0; if yes
* clear 64bit base, since overloaded base is always
* mapped to the Null selector
*/
if (fsindex)
prev->fs = 0;
[and the same for gs]
However, copy_thread() doesn't have the equivalent code, and __switch_to
clearly expects that to be maintained as an invariant -- it doesn't
check on entry, only on exit.
The following patch looks like it should address that.
-hpa
View attachment "diff" of type "text/plain" (653 bytes)
Powered by blists - more mailing lists