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 8DC4AC433FE for ; Thu, 24 Nov 2022 14:03:32 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a/ercbi+/ySzogNfcrvDLzxT/LM75r1Ad02NqRbUQcc=; b=wlqyQ92lqUwgxD 6Oa0knE/1O4oqBP19jyCjFKnr9r3ypnh/VCnLdG+4oHUDOSQljtaviUBimCie2pb/YPKL7zxZ5GZm AocvsEQ1YqRKMmZB9f/MFNKDdwj4gF1apwddMeBzyLi+NQjnqeWbA3c0D7/njN7LNFUchuNF+pulo kpFlVde343lJLJERie5gv1tvkgijyCYSO0wph3DXBv/iN7UV15Nhlf8LE4mcpy86VVald73l6vvv9 nb9OWTOHGI6fVZ2woaN4GhIrl61LqvwdAlwy8oZeiIXfTi8Ooh8JdL3L+o7jyXhBVPeniAucM+hFs z9CvQaZkT4Yemsrp+mbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCno-0094hQ-E6; Thu, 24 Nov 2022 14:02:08 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyCnk-0094fR-Lh for linux-arm-kernel@lists.infradead.org; Thu, 24 Nov 2022 14:02:06 +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 E9CA562161; Thu, 24 Nov 2022 14:02:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 514E0C433D6; Thu, 24 Nov 2022 14:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669298523; bh=e70dtgecMw+kPcN2RJMX/Qz2rAG4OZEf5sOqPhCjHLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b17ljwemWCXfiV61K4uemTCSsf5rHTZnkj/JISfFk6fs3aMPq4a98kUAe+E9P2E7x h4ATXR5F4bp/uJiE6VyWM8sr4Hy6uu10DBW0g2W/4vpUKon/B4ejbpgRFIFwFdAuPx VS+RTNvCikiLeDlhsq/6ZHqvpMblUuOIk8T53IiMJSdedwYsnIanE4+aaSqKtkKwjK AqLiUE6sO2GqZG8t7ClToO7JxDH/FolP85J9qkK3qDMMF0VpdfP0yzn/Bc4wbP3laq 4ZpYdzaSBGqFpHCTT1vk1qQaNYDT6i4pxYy/G497esATiv7lW94pJgN84qllFQQpH8 5Q7k1ruHfjBXg== From: Mark Brown To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, Mark Brown Subject: [PATCH v1 1/6] arm64/signal: Don't redundantly verify FPSIMD magic Date: Thu, 24 Nov 2022 13:58:13 +0000 Message-Id: <20221124135818.282955-2-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221124135818.282955-1-broonie@kernel.org> References: <20221124135818.282955-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1245; i=broonie@kernel.org; h=from:subject; bh=e70dtgecMw+kPcN2RJMX/Qz2rAG4OZEf5sOqPhCjHLQ=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjf3h1zYVBL+VWCdYhbOnM87ndsikrj57qe5SADjU+ /taVs/iJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY394dQAKCRAk1otyXVSH0BuwB/ 43829Crm0prEhw/xtzGHLsEnBO3TMMBVGTFNMiIouL8yxy0NI2C3m3qiLzW1xEGccssb85e6psPdQ2 Az/xmUXBXf2sMFXmR6PzyvQ8SoSVfqD6A1+Z9Ek4uBDv1IqGX6CvsMbFSz/aIl0jOI7YzTBOByoZml 5nAwSQARwNXAnh8EYcu0niMzTje8Sy47R7+unPHf3IgF+IjYn9KxMCeHZK9jHBNWFslxcVwQb6efMl ofHMIuC2FY8Bjd56BbqfB98E4iuXDHSu4DWvAkIsBFJvw7ltR9VPlX9+HmqniqX7erptlxEhtnQDRr NI4W6AYqoD2kk8C+H/WZHmpNSj8XxF 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-20221124_060204_776523_AF645AE6 X-CRM114-Status: GOOD ( 13.92 ) 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 9ad911f1647c..f9a98948a2c8 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