Re: [PATCH 02/19] x86, fpu: Wrap get_xsave_addr() to make it safer

From: Thomas Gleixner
Date: Tue May 19 2015 - 04:15:44 EST


On Mon, 18 May 2015, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
>
> The MPX code appears to be saving off the FPU in an unsafe
> way. It does not disable preemption or ensure that the
> FPU state has been allocated. All of the preemption safety
> comes from the unfortunatley-named 'unlazy_fpu()'.
>
> This patch introduces a new helper which will do both of
> those things internally.
>
> Note that this requires a patch from Oleg in order to work
> properly. It is currently in tip/x86/fpu.
>
> > commit f893959b0898bd876673adbeb6798bdf25c034d7
> > Author: Oleg Nesterov <oleg@xxxxxxxxxx>
> > Date: Fri Mar 13 18:30:30 2015 +0100
> >
> > x86/fpu: Don't abuse drop_init_fpu() in flush_thread()
>
> Signed-off-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
> Cc: bp@xxxxxxxxx
> Cc: Rik van Riel <riel@xxxxxxxxxx>
> Cc: Suresh Siddha <sbsiddha@xxxxxxxxx>
> Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx>
> Cc: the arch/x86 maintainers <x86@xxxxxxxxxx>

Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
--
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/