]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/xsave.c
x86, xsave: clear the user buffer before doing fxsave/xsave
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / xsave.c
index 7415f3e38a5160a9fc9914345f1c1efcc8be0606..bb097b1644d832025a6bc453ad158fdd45d8daa0 100644 (file)
@@ -92,6 +92,12 @@ int save_i387_xstate(void __user *buf)
                return 0;
        clear_used_math(); /* trigger finit */
        if (task_thread_info(tsk)->status & TS_USEDFPU) {
+               /*
+                * Start with clearing the user buffer. This will present a
+                * clean context for the bytes not touched by the fxsave/xsave.
+                */
+               __clear_user(buf, sig_xstate_size);
+
                if (task_thread_info(tsk)->status & TS_XSAVE)
                        err = xsave_user(buf);
                else