From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0577C3DA7D for ; Tue, 3 Jan 2023 20:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cxzlnKwQa0/O58MM2/J7tJakXVukBA6uyhJsEJ6ZHV8=; b=FATq7ClcKumA4p vMmcFGGz1bXv4kMULW3Ba5JrO4xpOv8xJEVElwibjYuTCu4JxU8KrvqNtx7rm9jZS+10RwyrmxhNA X3tFqg1ObnRK4EqZmZ9y1s1+xrRjN4Y36WCCsLXfZVcYZPpYEFVUc/sRua2uwTd7aOfyqejO3k4i6 3NoawWpYMXTEHB5shzTVvdV+Yvkor6CRokqbVF9NRZUy/i3Dq+AfQUA+ekRJnFjUn05GndN9gxhSA gmSXdQ/KrfhvXshhusGD4JHMZbFAXBkAJWjoqfyLQDVoCMaWuPaGK+IYRHJMPrXyC441m4qA5nGq+ oRUlB5m8Q7ZQbXDWLlTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCnsC-004jOH-TM; Tue, 03 Jan 2023 20:27:01 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pCnqr-004j8n-RA for linux-arm-kernel@lists.infradead.org; Tue, 03 Jan 2023 20:25:39 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30283614FE; Tue, 3 Jan 2023 20:25:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88A5CC433B0; Tue, 3 Jan 2023 20:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672777536; bh=zFC31q+ex+1Dl3BDwtcnroCVfROJ0aqVLE555+t4k/s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=R/L1HV0Dq6n53aNNnFFlg83TGKpPpHSMTjNvh4z6pems6ig10W/eGh7lAatJddfHl TFnhMs2ecWcMKwUq9Z6Tv+w4TiPy9AvABwZzIeVe+RcBdB6m7ncgm27hN/HjFym86E rPWUXZiFeeIAwW7RbOL6naMf9wBqXrVAFrh08DxFAoapBzoTWr5vX2lcUifx+/ojS5 iluVczswqBEXcreZLxHxJTqbrUWzKozXsmUy/7sxqhw2jBlYiNwnJ/F7TdM46DIH6z K58g2basDaMccxTc84UkTKmvWCfKZc57PVlQI6CbqYwovWR75k6RxDznRTdpLOc9hn kcM+3wzAC/TvA== From: Mark Brown Date: Tue, 03 Jan 2023 20:25:15 +0000 Subject: [PATCH v2 1/6] arm64/signal: Don't redundantly verify FPSIMD magic MIME-Version: 1.0 Message-Id: <20221212-arm64-signal-cleanup-v2-1-14a8f3e088b7@kernel.org> References: <20221212-arm64-signal-cleanup-v2-0-14a8f3e088b7@kernel.org> In-Reply-To: <20221212-arm64-signal-cleanup-v2-0-14a8f3e088b7@kernel.org> To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.12-dev-214b3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1247; i=broonie@kernel.org; h=from:subject:message-id; bh=zFC31q+ex+1Dl3BDwtcnroCVfROJ0aqVLE555+t4k/s=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjtI85VdbUmWZx8pESGvVVzybsGVa/FrGZIdhgibbe LHcz2syJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY7SPOQAKCRAk1otyXVSH0Fk1B/ 9OGuQiovaH9EVYAhVRVZPIrfWq046KVBbZSCyKVgx3wFdkm3xfcwW10T2edp6UKYr0qCHOKC/85dlQ dYzOrCdNmYTbqaLKDeYvcqFCCBnAB2fNjCoqFv9VkvFQ/e6BwntCCM+ASUFN51g6dpZ5cnBQywl4Zh hSCas1IPotkR2yiefDL78cn/xdnJZhCsT6HHqJxxxWGRrgm1F3vPhmAmiG5jkgDZQQHUZIa/c/XAZu ud6Vy0+N27bA89FJBsU5cPjdW6ICvjDmiz1yIieVveJ+dsoIEOa+pvXGKE8+LKJ2Xjmk3MPZ7Isht2 YvHD7vKZcnmuUvL/XPTNZh3CrYLG09 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230103_122538_048324_D7E2F928 X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We validate that the magic in the struct fpsimd_context is correct in restore_fpsimd_context() but this is redundant since parse_user_sigframe() uses this magic to decide to call the function in the first place. Remove the extra validation. Signed-off-by: Mark Brown --- arch/arm64/kernel/signal.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index e0d09bf5b01b..9d3d10269da7 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -189,15 +189,14 @@ static int preserve_fpsimd_context(struct fpsimd_context __user *ctx) static int restore_fpsimd_context(struct fpsimd_context __user *ctx) { struct user_fpsimd_state fpsimd; - __u32 magic, size; + __u32 size; int err = 0; - /* check the magic/size information */ - __get_user_error(magic, &ctx->head.magic, err); + /* check the size information */ __get_user_error(size, &ctx->head.size, err); if (err) return -EFAULT; - if (magic != FPSIMD_MAGIC || size != sizeof(struct fpsimd_context)) + if (size != sizeof(struct fpsimd_context)) return -EINVAL; /* copy the FP and status/control registers */ -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel