>From 599d3ee9a9e743377739480a8a893582f1409a8d Mon Sep 17 00:00:00 2001 From: Hans Rosenfeld Date: Wed, 6 Jul 2011 16:31:19 +0200 Subject: [PATCH 1/1] x86, xsave: clear pre-allocated xsave area Bogus data in the xsave area can cause xrstor to panic, so make sure that the pre-allocated xsave area is all nice and clean before being used. Signed-off-by: Hans Rosenfeld --- arch/x86/kernel/process.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index c5ae256..03c5ded 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -28,8 +28,15 @@ EXPORT_SYMBOL_GPL(task_xstate_cachep); int arch_prealloc_fpu(struct task_struct *tsk) { - if (!fpu_allocated(&tsk->thread.fpu)) - return fpu_alloc(&tsk->thread.fpu); + if (!fpu_allocated(&tsk->thread.fpu)) { + int err = fpu_alloc(&tsk->thread.fpu); + + if (err) + return err; + + fpu_clear(&tsk->thread.fpu); + } + return 0; } -- 1.5.6.5