Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp950810pxb; Tue, 14 Sep 2021 12:21:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeMEeHnhgoislQQdhHVvU+Jd1xmOR/Z702H+lc9+Mb04JMEBJ+uA7893UW3DLxOS5BMK47 X-Received: by 2002:ac2:5cac:: with SMTP id e12mr11823478lfq.624.1631647300603; Tue, 14 Sep 2021 12:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631647300; cv=none; d=google.com; s=arc-20160816; b=dbB5gWlf/5Z7WhaiAUBPBdiaeXgX7K6PPV3QeThWphAhUJVjIPpY3JgHDwRR4h9inA deaghjfjIR2PwbMkj9jRZkD9Re4GeCPXgdVZcg2n/IEnQO+bPKDM8/kzjnGpViNevKgX zkoNdbkfWBhmEOfY9a0zWyXCBt8dNufGH1tQuexuwTUeh4dMs/K85b1G6928A1Do53Gp H27fgSU7JtY5jHn6gW4mmP78UnESm/z+Qu9/BzWXEkBbCnf0YvmRDOFDJbajMdFnbWh/ V/jaLo0S+Rs6F9bAHPOH8lC6bCdfG589m6litP4pXWQkrjWe5y5o0lwtp18fSRXdZ2z2 JXEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=bc232R7rmwgGegkLoWgxJiiK3P1hZI5ttoMdfS+p9+o=; b=JEJZlHaORBnDFCh8nXYSMYG47Mlq0A0NJhheTXwHuotE9PXV8bZ1uA2uhWMuJHxt9i Fcsl/kLI5Yia6VPEeLLFDKIdfGFMT4M3txh4lsi4UQ9Jpquiih/liiPsOaSX8ItHwoxs Fkq621NmMYB/HUaOuQaiY4Ja1xJcz1T4igj6vq2N5kuLTVa7JftmVvYAXCXbOxBhaAZ7 lOJ4mZulq4WXA+Jg0on73Lmih/ctdCuzAwXuu0RYfJNhPwAZ668oauk4YdRaAqANY9sq hs/88ywE1I1iYKmp8h4x/yLE/wOQfOlehSwpPurRagqEbluOHMwKNRmBy7y4j48JK8hl gcoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nPDMn6df; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si12731947ljj.554.2021.09.14.12.21.12; Tue, 14 Sep 2021 12:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=nPDMn6df; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232950AbhINTU4 (ORCPT + 99 others); Tue, 14 Sep 2021 15:20:56 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:35346 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbhINTUr (ORCPT ); Tue, 14 Sep 2021 15:20:47 -0400 Date: Tue, 14 Sep 2021 19:19:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1631647168; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bc232R7rmwgGegkLoWgxJiiK3P1hZI5ttoMdfS+p9+o=; b=nPDMn6dfozRKFXl8Q/DdTgrux4vNXvWp65WlHBcVaguN8Cerjggjv9zu/r9UWhaGXkbdZz 4NHw+AbE1holwGcg0SqO1pVHap8Ild7A9T70H8xgMmaBzf8+Hp4DjJLoUIroxs32/bhUvF XUAJKsOY0NbEmcoe/E0GazMnrT7tlptZoLG3CTttdKkRWbR4jQtPvfgePIsIQlxON9bh7T ZOSuCcuuHTBOLTJ+m48DdwaL4iRc6U4Q3ro345DL0Zo4G5OptSbu3Ic1etyAjyHBQpf+lk eogF9hQVo+nXOKyBHwPR0laZfQErot50VkmV0lnm9fK8NlJLW3IMq8jxSorQng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1631647168; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bc232R7rmwgGegkLoWgxJiiK3P1hZI5ttoMdfS+p9+o=; b=nw08rz7igD3pba3ieRieD3eg/OGfApFAgvj2xvF0190VwBHDopVk5EaJEfgU57z+3k3h7i p9XOnlvqekqnUyDg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fpu] x86/fpu/signal: Change return type of copy_fpregs_to_sigframe() helpers to boolean Cc: Thomas Gleixner , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210908132525.794334915@linutronix.de> References: <20210908132525.794334915@linutronix.de> MIME-Version: 1.0 Message-ID: <163164716781.25758.2102777588293339042.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/fpu branch of tip: Commit-ID: 2af07f3a6e9fb81331421ca24b26a96180d792dd Gitweb: https://git.kernel.org/tip/2af07f3a6e9fb81331421ca24b26a96180d792dd Author: Thomas Gleixner AuthorDate: Wed, 08 Sep 2021 15:29:34 +02:00 Committer: Borislav Petkov CommitterDate: Tue, 14 Sep 2021 21:10:03 +02:00 x86/fpu/signal: Change return type of copy_fpregs_to_sigframe() helpers to boolean Now that copy_fpregs_to_sigframe() returns boolean the individual return codes in the related helper functions do not make sense anymore. Change them to return boolean success/fail. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20210908132525.794334915@linutronix.de --- arch/x86/kernel/fpu/signal.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c index 7ce396d..1d10fe9 100644 --- a/arch/x86/kernel/fpu/signal.c +++ b/arch/x86/kernel/fpu/signal.c @@ -65,7 +65,7 @@ setfx: /* * Signal frame handlers. */ -static inline int save_fsave_header(struct task_struct *tsk, void __user *buf) +static inline bool save_fsave_header(struct task_struct *tsk, void __user *buf) { if (use_fxsr()) { struct xregs_state *xsave = &tsk->thread.fpu.state.xsave; @@ -82,18 +82,19 @@ static inline int save_fsave_header(struct task_struct *tsk, void __user *buf) if (__copy_to_user(buf, &env, sizeof(env)) || __put_user(xsave->i387.swd, &fp->status) || __put_user(X86_FXSR_MAGIC, &fp->magic)) - return -1; + return false; } else { struct fregs_state __user *fp = buf; u32 swd; + if (__get_user(swd, &fp->swd) || __put_user(swd, &fp->status)) - return -1; + return false; } - return 0; + return true; } -static inline int save_xstate_epilog(void __user *buf, int ia32_frame) +static inline bool save_xstate_epilog(void __user *buf, int ia32_frame) { struct xregs_state __user *x = buf; struct _fpx_sw_bytes *sw_bytes; @@ -131,7 +132,7 @@ static inline int save_xstate_epilog(void __user *buf, int ia32_frame) err |= __put_user(xfeatures, (__u32 __user *)&x->header.xfeatures); - return err; + return !err; } static inline int copy_fpregs_to_sigframe(struct xregs_state __user *buf) @@ -218,10 +219,10 @@ retry: } /* Save the fsave header for the 32-bit frames. */ - if ((ia32_fxstate || !use_fxsr()) && save_fsave_header(tsk, buf)) + if ((ia32_fxstate || !use_fxsr()) && !save_fsave_header(tsk, buf)) return false; - if (use_fxsr() && save_xstate_epilog(buf_fx, ia32_fxstate)) + if (use_fxsr() && !save_xstate_epilog(buf_fx, ia32_fxstate)) return false; return true;