lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210922200901.1823741-1-anders.roxell@linaro.org>
Date:   Wed, 22 Sep 2021 22:09:01 +0200
From:   Anders Roxell <anders.roxell@...aro.org>
To:     tglx@...utronix.de, mingo@...hat.com, bp@...en8.de
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Anders Roxell <anders.roxell@...aro.org>,
        Remi Duraffort <remi.duraffort@...aro.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        andrew.cooper3@...rix.com
Subject: [PATCH] x86/fpu/signal: save_xstate_epilog: fix return polarity

Fix the missing return code polarity in function 'save_xstate_epilog()'.

Reported-by: Remi Duraffort <remi.duraffort@...aro.org>
Fixes: a2a8fd9a3efd ("x86/fpu/signal: Change return code of restore_fpregs_from_user() to boolean")
Tested-by: Nick Desaulniers <ndesaulniers@...gle.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1461
Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
Cc: andrew.cooper3@...rix.com
---
 arch/x86/kernel/fpu/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c
index 68f03da2012e..39c7bae97daf 100644
--- a/arch/x86/kernel/fpu/signal.c
+++ b/arch/x86/kernel/fpu/signal.c
@@ -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));
-- 
2.33.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ