Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp897092pxp; Sat, 19 Mar 2022 23:14:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLqHkr7rDqky2vvuUOrCg43SJs1x2hWu3spRRQ2TgwPwsPBwbJ5/bsvfMb1lnHZJV9YqIH X-Received: by 2002:a17:902:a415:b0:153:a1b6:729f with SMTP id p21-20020a170902a41500b00153a1b6729fmr7173759plq.52.1647756846899; Sat, 19 Mar 2022 23:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647756846; cv=none; d=google.com; s=arc-20160816; b=TkeFdYJK3Mm4j6vU1CthywgBqPHSSz228iZAFMPqhaem3D0Wl9iBcbXhiPXJJlxe+e y3EwOJ2Geo0qG3eUtmUE73GGiF1G+H301qea1WUmW8RbgGEkpEuZHgOZJViurQ2PUU9I Tyt6MLWnNWTI8Qz11WxkkfmzPpU+gZztJoAAjUtieCZNjuLIDafqkP989iVAcy2wLr4g +Qye28vD7sxXs2ChttabSn8O67MnTDlQQJtyl9qoRifJVrG+YEXb9tLZMw+fCTNkuIF+ j0o1l3Trhuxda0uKkIPT+GSjjHxoN5LEGQuLs76b2KAFi35tOJq0m5p2qQqzH9jBxB5Q OrRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xY3M7r4qtFqZuT5Uag0S4fjMFZeZaP18S8s7bLo3+lo=; b=P8AKDcM0Yz4UjFE/+bnooXP25/DjOtOPDMue1gPJc84HBSYKsesQ64zkNQVjtfFSqU WfUefTDdkaAH6lIwTDJ2Yx1IRF62fqAFMd6bJJwPzl3QR+2I0TfxJmF0skwCbgV2mKZE EmEPXqRYpy1SHjEVYfOVXAAwQPaxL1zzinkaYsi+XNEXlp6XXwzowsUzHZV8U0Qu3nRW gQcwt8UmnNSB7khlKaFOtSoNKnP06FYvBrgsM7A/t6mG2yy8sJpe+pSvNGQJtO/chaqJ x0Hulu18P2Q3tprte31SwyALqCkB5GY1gwjJe4Orv83YJSPKX7ANOFYJ6D2IqbpQw9eu 60Ww== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020a634a51000000b003816043ef7csi10009390pgl.369.2022.03.19.23.13.32; Sat, 19 Mar 2022 23:14:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239470AbiCRRvB (ORCPT + 99 others); Fri, 18 Mar 2022 13:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239799AbiCRRu4 (ORCPT ); Fri, 18 Mar 2022 13:50:56 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F00E160FEE; Fri, 18 Mar 2022 10:49:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0C3E01515; Fri, 18 Mar 2022 10:49:37 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 609593F7B4; Fri, 18 Mar 2022 10:49:36 -0700 (PDT) From: James Morse To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, james.morse@arm.com, catalin.marinas@arm.com Subject: [stable:PATCH v4.19.235 04/22] arm64: entry.S: Add ventry overflow sanity checks Date: Fri, 18 Mar 2022 17:48:24 +0000 Message-Id: <20220318174842.2321061-5-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220318174842.2321061-1-james.morse@arm.com> References: <20220318174842.2321061-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 commit 4330e2c5c04c27bebf89d34e0bc14e6943413067 upstream. Subsequent patches add even more code to the ventry slots. Ensure kernels that overflow a ventry slot don't get built. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse --- arch/arm64/kernel/entry.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 5f800384cb9a..297da3055793 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -70,6 +70,7 @@ .macro kernel_ventry, el, label, regsize = 64 .align 7 +.Lventry_start\@: #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 alternative_if ARM64_UNMAP_KERNEL_AT_EL0 .if \el == 0 @@ -127,6 +128,7 @@ alternative_else_nop_endif mrs x0, tpidrro_el0 #endif b el\()\el\()_\label +.org .Lventry_start\@ + 128 // Did we overflow the ventry slot? .endm .macro tramp_alias, dst, sym @@ -984,6 +986,7 @@ alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003 add x30, x30, #(1b - tramp_vectors) isb ret +.org 1b + 128 // Did we overflow the ventry slot? .endm .macro tramp_exit, regsize = 64 -- 2.30.2