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 BF993C00144 for ; Mon, 1 Aug 2022 23:01:55 +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: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:In-Reply-To:References: List-Owner; bh=mS5f8qy63JwpWQXJRzOoezdpoeWxVdDwhsdi3KLCaoM=; b=n++VGATU9+WBeY U6c/cLo5Xs36XcAYDtPP3u28CofYSIQ0KedZt+mX8g1luXf6QBkR3wLtMzWE9fMhJO00HDREnagNL USXk7I1hlmNig0IQevQ9dbxRG8BKXWOX9UntW1ZoTI7Rak+mFj2I59IJDG/iBttDlcXuip4CRra+L seX9OPT1FL1jYUamDbUOt8MkRIncBP2/YRYDvOr/MjC6wdmk4a7N09E9ENoM8/LP9AE/RKXRgyrlB x8+aKSsLB7u8Fonx14ZdhhMI0FWypOProdhDXHOgVEqP/4twMxBZXN5QctXhULX6JtEyonzRGqLc1 TYbKPk4X/TKlyRosgBpw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIeOi-00Bmzk-My; Mon, 01 Aug 2022 23:00:28 +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 1oIeOe-00Bmwy-Tq for linux-arm-kernel@lists.infradead.org; Mon, 01 Aug 2022 23:00:26 +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 4B46760EDD; Mon, 1 Aug 2022 23:00:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 130B9C433C1; Mon, 1 Aug 2022 23:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659394823; bh=f46da727UMwp0qF4GcIudvoi5bEzKDylM74tYNSaYaw=; h=From:To:Cc:Subject:Date:From; b=lzFJLe6SfQlbp+QzbH+DwVe1DXddJrfbWsEiBzhyNS7mkvZ1pqKjj6X2qy+LjATc5 eO/fky+onC420a2dNI/lzxJRJn8lDRWlaftgUtRQemv/q6+L/6+vGkHRlHDMoCtbQQ Fof2nRIlZu6iOEbKfozTnxrUySQ5P93WZavwe+Ley4MF36ahgt/pV+Cg8xXkE5zIaR vqfSmHL1FYHqrtCxu0CqoN+DTqhzhRohWFT5jV7Ltgc3FMfMK4DTbiWgz91WRYm5Q7 lw59QOUrFqeMwKBerbYUplfMBcg90dDH120p3xVn54anY90Q2+oukxbYMdOU8oxiGY 2LRrOJRHMns5w== From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, Mark Brown Subject: [PATCH] kselftest/arm64: Fix validation of EXTRA_CONTEXT signal contexts Date: Mon, 1 Aug 2022 23:59:26 +0100 Message-Id: <20220801225926.3694639-1-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1431; i=broonie@kernel.org; h=from:subject; bh=f46da727UMwp0qF4GcIudvoi5bEzKDylM74tYNSaYaw=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBi6FrO0U5z46d6gsZbaAcnAjate44USWKZeXRxsoj+ Dr5jWn6JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYuhazgAKCRAk1otyXVSH0LGFB/ oCGGw9A8Gm1C202pWD36qa1jWj4jgxLXkFUwWKAGmYJwFSoTZTmdG26nsITuTuuxZtvWTEB3h4sKWb Ky+XRHPZV3uTl5mgPnUrgEwyq2beDZ0vNEkOvynRNDmp+mEO9P2OBuUpcphi+ui0WI16CzyojJ2QTj qjRYHvpu5/ePL+G6GCfxqx3OlZovYZtvxL0deTMjoyu9H/A9tOYC9ZfG5OTqTGiqNWSFxSBZjxrgzn vZ5rf/7brk6X8SZJ7+Gd9sEnm5ryRybm2NmDMobnA9xDMeVqIt6te4GbP9NobQ2Aop9JMjHBweS2k6 uZ5VSFE+rxS96rJ7j1fG8a3q1ynFGZ 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-20220801_160025_076278_2657C1B0 X-CRM114-Status: GOOD ( 15.07 ) 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 Currently in validate_extra_context() we assert both that the extra data pointed to by the EXTRA_CONTEXT is 16 byte aligned and that it immediately follows the struct _aarch64_ctx providing the terminator for the linked list of contexts in the signal frame. Since struct _aarch64_ctx is an 8 byte structure which must be 16 byte aligned these cannot both be true. As documented in sigcontext.h and implemented by the kernel the extra data should be at the next 16 byte aligned address after the terminator so fix the validation to match. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/signal/testcases/testcases.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/signal/testcases/testcases.c b/tools/testing/selftests/arm64/signal/testcases/testcases.c index b2cce9afaaf3..0b3c9b4b1d39 100644 --- a/tools/testing/selftests/arm64/signal/testcases/testcases.c +++ b/tools/testing/selftests/arm64/signal/testcases/testcases.c @@ -42,7 +42,7 @@ bool validate_extra_context(struct extra_context *extra, char **err) *err = "Extra DATAP misaligned"; else if (extra->size & 0x0fUL) *err = "Extra SIZE misaligned"; - else if (extra->datap != (uint64_t)term + sizeof(*term)) + else if (extra->datap != (uint64_t)term + 0x10UL) *err = "Extra DATAP misplaced (not contiguous)"; if (*err) return false; -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel