From patchwork Wed Oct 19 08:55:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 5080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp249376wrs; Wed, 19 Oct 2022 03:46:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6apksiO5rLyM/L5kv4mtfhufh2zQBdPn7PKtAU9kQJK4VFSCkZcZJJUKGJnYW3YdMP31SI X-Received: by 2002:a17:902:db0b:b0:185:51cc:8113 with SMTP id m11-20020a170902db0b00b0018551cc8113mr7511986plx.64.1666176362587; Wed, 19 Oct 2022 03:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176362; cv=none; d=google.com; s=arc-20160816; b=zsQvihBUnCIc2buMYz2V1k1LscZTDXFR0pUJS6RM2KMEOStYqcfc2sAlYIKu4j8oOE 12R5J22qRFXr0/qUWJFKmPC6/zdmfqMu2nt8PpCKweTg8zRBSH2XyCyFZb1ZtWtL/UIs afb4PUw7yGux5LqwAU/yUPbwPm2Cke2EUfVdzYFkU5EhrGdH/qH+WzzfIZJTCCyxATOK gmacyVQyqIbWRfwgp3elf0R5/KxwlsASsFP8nRSWnVPBhE5lrwtJlb1/AUt/+eC+Zc4m jI2iocSXo1r4vL0Jss2DGlBZYyQrjiDXm/GEKU5NCTIXmWDEQFOU8i7dyqDjY0F11h0v 7SWg== 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=qcApPFNPof4JyRnCxYWKlA1/9FtTi7A5R8T88Sz/KLc=; b=mdleZoi8hDwW90PofYKrUh/b2F/s0jSk1V0EDgHcmGdjmUWW+z1zWVAgq442GkIXlh NLatpDtz8Kh8XXy6Fk7QnWh5EfdzzPVeXU3ZMs7OJhojlNFW8bCLyx0Nz1pYnHmULA3C sGsYKCIjqY4TJIBMR1VgoFYOFx0DVlurEpkff8sPPSyulknBmeH4HjNvMiDcktnTCxQF 1aS1EQUzUhFqAKJmLdTXtU4fOE5PiNesRZlk4fo7PYHYL9xAok3cygpfGZP1FSke7hvL k3uX13wsPYyy2D9DZq9/hpNir1987wb+mjCunv08foVxb2O8K+mPwJz91EupYH4Tmm0z /Fmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fm+fWlnY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=807mWOIP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a655547000000b0044189a7cf37si19917544pgr.323.2022.10.19.03.45.48; Wed, 19 Oct 2022 03:46:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fm+fWlnY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=807mWOIP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232942AbiJSKpb (ORCPT + 99 others); Wed, 19 Oct 2022 06:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232265AbiJSKnk (ORCPT ); Wed, 19 Oct 2022 06:43:40 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 421D4B5FF7; Wed, 19 Oct 2022 03:20:49 -0700 (PDT) Date: Wed, 19 Oct 2022 08:55:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666169750; 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=qcApPFNPof4JyRnCxYWKlA1/9FtTi7A5R8T88Sz/KLc=; b=fm+fWlnYpS7XS+myDdk1J06EbQ5NFU78ocjHzR/Sf50xLUhw7uzmXMl/lkme9aGWaDfBHP UwmOIHBjKGOS9y5SB3m/O3/BPzTtwI0RkU6541Mc3aSym7ZJ/VBwWo6NwrlOS13ijDvn7n pAcVdVuRPCGrVw82yCh9FzCIusNlQzrcc4EHc5iex5apFZ4uCKN7cBfMqRrcd6d5pteLgJ loTxAFA3ppoOg+3nrWBghib+FKQiTvIXFSMW5uhe5MIn73BPoGKd4CgLIvA1ChD/E3N/eV AtbrTdePG3ymzbo37SohPjMOjGn4Rj1TWwhZzUTBx0uJjU/t/2jEIYNEEDlLBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666169750; 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=qcApPFNPof4JyRnCxYWKlA1/9FtTi7A5R8T88Sz/KLc=; b=807mWOIPQNGJTjP4/aId+83y8F1dZziizxaxwtVe5N/e32vUO1npNYqStr516U3AkEsAF4 LxdpJjT8YGj0LMBw== From: "tip-bot2 for Brian Gerst" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/misc] x86/signal: Remove sigset_t parameter from frame setup functions Cc: Brian Gerst , Borislav Petkov , "Eric W. Biederman" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220606203802.158958-3-brgerst@gmail.com> References: <20220606203802.158958-3-brgerst@gmail.com> MIME-Version: 1.0 Message-ID: <166616974818.401.5661686003687651870.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747112545634907743?= X-GMAIL-MSGID: =?utf-8?q?1747112545634907743?= The following commit has been merged into the x86/misc branch of tip: Commit-ID: f544822ea587ce08932640d5ba3978261148cbc7 Gitweb: https://git.kernel.org/tip/f544822ea587ce08932640d5ba3978261148cbc7 Author: Brian Gerst AuthorDate: Mon, 06 Jun 2022 16:37:56 -04:00 Committer: Borislav Petkov CommitterDate: Wed, 19 Oct 2022 09:58:48 +02:00 x86/signal: Remove sigset_t parameter from frame setup functions Push down the call to sigmask_to_save() into the frame setup functions. Thus, remove the use of compat_sigset_t outside of the compat code. Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov Acked-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/20220606203802.158958-3-brgerst@gmail.com Signed-off-by: Borislav Petkov --- arch/x86/ia32/ia32_signal.c | 8 ++++---- arch/x86/include/asm/fpu/signal.h | 6 ++---- arch/x86/include/asm/signal.h | 5 ----- arch/x86/kernel/signal.c | 28 ++++++++++++---------------- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 390347a..b67e276 100644 --- a/arch/x86/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c @@ -230,9 +230,9 @@ static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, return (void __user *) sp; } -int ia32_setup_frame(struct ksignal *ksig, - compat_sigset_t *set, struct pt_regs *regs) +int ia32_setup_frame(struct ksignal *ksig, struct pt_regs *regs) { + compat_sigset_t *set = (compat_sigset_t *) sigmask_to_save(); struct sigframe_ia32 __user *frame; void __user *restorer; void __user *fp = NULL; @@ -296,9 +296,9 @@ Efault: return -EFAULT; } -int ia32_setup_rt_frame(struct ksignal *ksig, - compat_sigset_t *set, struct pt_regs *regs) +int ia32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { + compat_sigset_t *set = (compat_sigset_t *) sigmask_to_save(); struct rt_sigframe_ia32 __user *frame; void __user *restorer; void __user *fp = NULL; diff --git a/arch/x86/include/asm/fpu/signal.h b/arch/x86/include/asm/fpu/signal.h index 08826ad..2f255ac 100644 --- a/arch/x86/include/asm/fpu/signal.h +++ b/arch/x86/include/asm/fpu/signal.h @@ -14,10 +14,8 @@ # include # include struct ksignal; -int ia32_setup_rt_frame(struct ksignal *ksig, - compat_sigset_t *set, struct pt_regs *regs); -int ia32_setup_frame(struct ksignal *ksig, - compat_sigset_t *set, struct pt_regs *regs); +int ia32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs); +int ia32_setup_frame(struct ksignal *ksig, struct pt_regs *regs); #else # define user_i387_ia32_struct user_i387_struct # define user32_fxsr_struct user_fxsr_struct diff --git a/arch/x86/include/asm/signal.h b/arch/x86/include/asm/signal.h index 2dfb5fe..4a4043c 100644 --- a/arch/x86/include/asm/signal.h +++ b/arch/x86/include/asm/signal.h @@ -28,11 +28,6 @@ typedef struct { #define SA_IA32_ABI 0x02000000u #define SA_X32_ABI 0x01000000u -#ifndef CONFIG_COMPAT -#define compat_sigset_t compat_sigset_t -typedef sigset_t compat_sigset_t; -#endif - #endif /* __ASSEMBLY__ */ #include #ifndef __ASSEMBLY__ diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 40b1373..489a085 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -324,9 +324,9 @@ static const struct { }; static int -__setup_frame(struct ksignal *ksig, sigset_t *set, - struct pt_regs *regs) +__setup_frame(struct ksignal *ksig, struct pt_regs *regs) { + sigset_t *set = sigmask_to_save(); struct sigframe __user *frame; void __user *restorer; void __user *fp = NULL; @@ -379,9 +379,9 @@ Efault: return -EFAULT; } -static int __setup_rt_frame(struct ksignal *ksig, - sigset_t *set, struct pt_regs *regs) +static int __setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { + sigset_t *set = sigmask_to_save(); struct rt_sigframe __user *frame; void __user *restorer; void __user *fp = NULL; @@ -458,9 +458,9 @@ static unsigned long frame_uc_flags(struct pt_regs *regs) return flags; } -static int __setup_rt_frame(struct ksignal *ksig, - sigset_t *set, struct pt_regs *regs) +static int __setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { + sigset_t *set = sigmask_to_save(); struct rt_sigframe __user *frame; void __user *fp = NULL; unsigned long uc_flags; @@ -560,11 +560,10 @@ int copy_siginfo_to_user32(struct compat_siginfo __user *to, } #endif /* CONFIG_X86_X32_ABI */ -static int x32_setup_rt_frame(struct ksignal *ksig, - compat_sigset_t *set, - struct pt_regs *regs) +static int x32_setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { #ifdef CONFIG_X86_X32_ABI + compat_sigset_t *set = (compat_sigset_t *) sigmask_to_save(); struct rt_sigframe_x32 __user *frame; unsigned long uc_flags; void __user *restorer; @@ -763,22 +762,19 @@ static inline int is_x32_frame(struct ksignal *ksig) static int setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) { - sigset_t *set = sigmask_to_save(); - compat_sigset_t *cset = (compat_sigset_t *) set; - /* Perform fixup for the pre-signal frame. */ rseq_signal_deliver(ksig, regs); /* Set up the stack frame */ if (is_ia32_frame(ksig)) { if (ksig->ka.sa.sa_flags & SA_SIGINFO) - return ia32_setup_rt_frame(ksig, cset, regs); + return ia32_setup_rt_frame(ksig, regs); else - return ia32_setup_frame(ksig, cset, regs); + return ia32_setup_frame(ksig, regs); } else if (is_x32_frame(ksig)) { - return x32_setup_rt_frame(ksig, cset, regs); + return x32_setup_rt_frame(ksig, regs); } else { - return __setup_rt_frame(ksig, set, regs); + return __setup_rt_frame(ksig, regs); } }