]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/fpu/signal: Fix missed conversion to correct boolean retval in save_xstate_epilog()
authorAnders Roxell <anders.roxell@linaro.org>
Wed, 22 Sep 2021 20:09:01 +0000 (22:09 +0200)
committerBorislav Petkov <bp@suse.de>
Thu, 23 Sep 2021 08:52:20 +0000 (10:52 +0200)
Fix the missing return code polarity in save_xstate_epilog().

 [ bp: Massage, use the right commit in the Fixes: tag ]

Fixes: 2af07f3a6e9f ("x86/fpu/signal: Change return type of copy_fpregs_to_sigframe() helpers to boolean")
Reported-by: Remi Duraffort <remi.duraffort@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1461
Link: https://lkml.kernel.org/r/20210922200901.1823741-1-anders.roxell@linaro.org
arch/x86/kernel/fpu/signal.c

index 68f03da2012eddf3ecd866870d573824adff1076..39c7bae97daf1157f7436b55c9b43ed89e3555b3 100644 (file)
@@ -106,7 +106,7 @@ static inline bool save_xstate_epilog(void __user *buf, int ia32_frame)
        err = __copy_to_user(&x->i387.sw_reserved, sw_bytes, sizeof(*sw_bytes));
 
        if (!use_xsave())
-               return err;
+               return !err;
 
        err |= __put_user(FP_XSTATE_MAGIC2,
                          (__u32 __user *)(buf + fpu_user_xstate_size));