From patchwork Thu Jul 20 18:38:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13320988 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 23B5EEB64DA for ; Thu, 20 Jul 2023 18:39:30 +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:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Fgx0fGuqKsSo1th7PXm1VxyvVvKeJtdbI5HUlxEC4WM=; b=w8v8KvxV/+OScF Fqs22qQKehc+GPkKzyfoHHjT6uKnlBvS4nkD1STeaf9K4zwBE3NPNfIrHBfECVRd9N79O9dMOM1rh Win74RY2wSJpLVt3vBhcZ8ak7p3PH4R6LNjQnUBfXkNDJyxDrwnkuPZ2aWd0uVCkGDGr7YsjtpYYe cqdKpmlkAv2C+YV9YCqXCxP7QmwrNBNWk5JAH96sx5ggFl5I95cvKaUeTLkw/RX0xFDGFpz44ZyJn 3eTTxAODndrH677vPtA9RJa+mmLkV3w0Qrj3OVaqBtDeKinoZ8G6kriyCYDX3iCRPfIzY0DJDuTrQ eXNMpNydj/PhXXRi8wpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMYYS-00Buto-2d; Thu, 20 Jul 2023 18:39:12 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMYYP-00Busi-1u for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2023 18:39:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0154561BF2; Thu, 20 Jul 2023 18:39:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DABCDC433C8; Thu, 20 Jul 2023 18:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689878348; bh=8e4Akz9WsSzK3omseih/f3BlHrS7YZVf/pCD/Nyk1eQ=; h=From:Subject:Date:To:Cc:From; b=Ewmy2d4CrOmRkGnbIlFIwR646fvj+Mc70TquhXJF7AezIplBXG+Cds6X39iY69S3x k6+LNcLz1Pth3g8qDfKqAY92whF5WvvPT0pP+EjW2L/0vQ1ISHugJcGMypVfCwkd7G A9fykN3xwBbWkcNyqLl6/fNZ1oY2VnoT+WVsvuPk4CAGBi9V2TR2+GmLFOIr8FAzBs BRz291uQbbj2Ep4ooVtwr/plEdTmrh5Vl0mUr+HPYuP9rAP+IKQ1A4mRfh3YAw/uQi jraTu5Y3xct0CZdLt5Jhqp7KA9bQ7sNahsY8bZx2tHHiLRdoG1yvQNTjQFVOZBjqNa KS3oEQbsx7D5A== From: Mark Brown Subject: [PATCH v2 0/3] arm64/fpsimd: Fix use after free in SME when changing SVE VL Date: Thu, 20 Jul 2023 19:38:57 +0100 Message-Id: <20230720-arm64-fix-sve-sme-vl-change-v2-0-8eea06b82d57@kernel.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAEF/uWQC/42NQQ6CMBBFr0Jm7ZhOS4q68h6GRbUDNAI1U9NoC He3Eg/g8v28vL9AYgmc4FQtIJxDCnEuoHcV3AY394zBFwattFENGXQy2Rq78MKUGdPEmEf8qVb xlTpnXaMaKIWHcBG3+qUtPIT0jPLezjJ91/+6mVAh6aP3B0tUkznfWWYe91F6aNd1/QDz9Rv8x wAAAA== To: Catalin Marinas , Will Deacon , Shuah Khan Cc: David Spickett , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Brown , stable@vger.kernel.org X-Mailer: b4 0.13-dev-099c9 X-Developer-Signature: v=1; a=openpgp-sha256; l=1137; i=broonie@kernel.org; h=from:subject:message-id; bh=8e4Akz9WsSzK3omseih/f3BlHrS7YZVf/pCD/Nyk1eQ=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBkuX9GAwk8cEP4Cn+OXwPxHcGTGJ7cz3SxsouNWVRq N3lFxD6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZLl/RgAKCRAk1otyXVSH0GV2B/ wJ+AgIoXIuJXZ/qt5peMxjTojQ6I7eEnXd+mopSLM46ZK2Mfhh04sfNMkwFFgMGWja4sN4Zl98st9Y 1yt6eY2A+ScPHWnnKatZd/1k3s+mooNA9ic34Em0+KyLx62ZJA1Gwg25CyQN7Yh8zwfyNJwZV2FPTV TT0ply8+G4pehCpqMGuSnQZ+YZgml1j5hsbxCRoagBEp5jwY4jnHTJBLTIkfmf4IkcpDESDRLwIF03 s0pBC5vfiUz7D1af1qPKgqoPki3UPZe3Vxw8gByxqU4Z4tNK0EvesulJlbHUuECM/ua95UJbFFv35W LWznzerBRZXmcIGf6CKkwix/pFHAp1 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-20230720_113909_673581_E1622AE8 X-CRM114-Status: GOOD ( 10.39 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series fixes an issue which David Spickett found where if we change the SVE VL while SME is in use we can end up attempting to save state to an unallocated buffer and adds testing coverage for that plus a bit more coverage of VL changes, just for paranioa. Signed-off-by: Mark Brown --- Changes in v2: - Always reallocate the SVE state. - Rebase onto v6.5-rc2. - Link to v1: https://lore.kernel.org/r/20230713-arm64-fix-sve-sme-vl-change-v1-0-129dd8611413@kernel.org --- Mark Brown (3): arm64/fpsimd: Ensure SME storage is allocated after SVE VL changes kselftest/arm64: Add a test case for SVE VL changes with SME active kselftest/arm64: Validate that changing one VL type does not affect another arch/arm64/kernel/fpsimd.c | 33 +++++-- tools/testing/selftests/arm64/fp/vec-syscfg.c | 127 +++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 12 deletions(-) --- base-commit: 06785562d1b99ff6dc1cd0af54be5e3ff999dc02 change-id: 20230713-arm64-fix-sve-sme-vl-change-60eb1fa6a707 Best regards,