Re: [PATCH v2 2/2] x86_64,signal: Remove 'fs' and 'gs' from sigcontext

From: Borislav Petkov
Date: Wed Mar 11 2015 - 05:29:47 EST


On Tue, Mar 10, 2015 at 07:03:25AM -0700, Andy Lutomirski wrote:
> As far as I can tell, these fields have been set to zero on save and
> ignored on restore since Linux was imported into git. Rename them

Actually from the very beginning:

commit 47f16da277d10ef9494f3e9da2a9113bb22bcd75
Author: Andi Kleen <ak@xxxxxx>
Date: Tue Feb 12 20:17:35 2002 -0800

[PATCH] x86_64 merge: arch + asm

...

+static int
+setup_sigcontext(struct sigcontext *sc, struct _fpstate *fpstate,
+ struct pt_regs *regs, unsigned long mask)
+{
+ int tmp, err = 0;
+
+ tmp = 0;
+ __asm__("movl %%gs,%0" : "=r"(tmp): "0"(tmp));
+ err |= __put_user(tmp, (unsigned int *)&sc->gs);
+ __asm__("movl %%fs,%0" : "=r"(tmp): "0"(tmp));
+ err |= __put_user(tmp, (unsigned int *)&sc->fs);


> '__pad1' and '__pad2' to avoid confusion and to allow them to be
> recycled some day.
>
> I'm intentionally avoiding calling either of them __pad0: the field
> formerly known as __pad0 is now ss.
>
> Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxxxxxx>

Acked-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/