From: Anders Roxell <anders.roxell@linaro.org>
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Anders Roxell <anders.roxell@linaro.org>,
Remi Duraffort <remi.duraffort@linaro.org>,
Nick Desaulniers <ndesaulniers@google.com>,
andrew.cooper3@citrix.com
Subject: [PATCH] x86/fpu/signal: save_xstate_epilog: fix return polarity
Date: Wed, 22 Sep 2021 22:09:01 +0200 [thread overview]
Message-ID: <20210922200901.1823741-1-anders.roxell@linaro.org> (raw)
Fix the missing return code polarity in function 'save_xstate_epilog()'.
Reported-by: Remi Duraffort <remi.duraffort@linaro.org>
Fixes: a2a8fd9a3efd ("x86/fpu/signal: Change return code of restore_fpregs_from_user() to boolean")
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1461
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Cc: andrew.cooper3@citrix.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
next reply other threads:[~2021-09-22 20:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-22 20:09 Anders Roxell [this message]
2021-09-23 9:00 ` [tip: x86/fpu] x86/fpu/signal: Fix missed conversion to correct boolean retval in save_xstate_epilog() tip-bot2 for Anders Roxell
2021-09-23 17:49 ` [PATCH] x86/fpu/signal: save_xstate_epilog: fix return polarity Guillaume Tucker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210922200901.1823741-1-anders.roxell@linaro.org \
--to=anders.roxell@linaro.org \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=remi.duraffort@linaro.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).