Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1211067pxb; Wed, 6 Apr 2022 11:25:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFFJJv0OC7imgGnzf/tT8hbcxT6QTPl4hFZv9AO7PDp8SggokiER+pv9qbuDxJYOf5buPH X-Received: by 2002:a17:902:758c:b0:154:667f:e365 with SMTP id j12-20020a170902758c00b00154667fe365mr10263410pll.120.1649269533039; Wed, 06 Apr 2022 11:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649269533; cv=none; d=google.com; s=arc-20160816; b=jAx4pAsuLUHljZA+KdIeIFgcmPDDcomZLI6FDBo6Z6nru6v0wkTAdrAFgKimbD076/ +unBbXdyB5FL4hmoO46+lxAOdF/iEliATK8ExxG9yUxAmn9TpHG+fql6Qte6Yg+o45XB 8fSZx/nuB/Qmh7EVzAVlv2wBOKQbR/R6cXVwlxmQnBzIT+IZ0vMBKMZwVqm9vTP4pyl9 RWuteZ60ICEMerEPKtZmGmIlcQpwG6QTPO/Q7MavbdJd4getQgG+R1n0VYXKnKTl3Grd hcxpxeUEPHt4W09taFqnIOyjnuVY2uxsUFr6msLCEOvXkwP69xYIY4O6fkWlqtRXHU/m pxNw== 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=aGrzU/0CA78iEkaaAl8psrfc8iguQbU6j9z1aCC8atg=; b=LBLjlt/88buG2WVUmPlUiLnPpVAy6ZO81fAhHBGsjpuZZJtSd5xT/iZDtSL/Ta2Jrm 5YfzOxSzIo0dPivfdRlnIGT1vK+XjTLOfhJ+MuKFyD/FHGC9i6az0n8qJvXUo9Waxge9 mkfgGdwJcDfveYyPXVBS+EFsFLPbPyQbDYFdoCclyIHGgKU1hmUsf4Ez8UCpfAuNQNBT qxlESKm0uwN4F1159Hy/MBqE+jNwfGdyteZgDmKTp5zu4ZGX9N+dwh60cnoeOL5/pS0p DiKidT3Q0vl+g50tdGxiYvNGs3JHWNxZBMoUTG1DLOioGJ7YEA8lE/njp+1qEV3TZLea i79Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 201-20020a6307d2000000b003995a4f48c4si6073129pgh.377.2022.04.06.11.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 11:25:33 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CA739218D8C; Wed, 6 Apr 2022 11:08:30 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240186AbiDFSKG (ORCPT + 99 others); Wed, 6 Apr 2022 14:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240515AbiDFSIE (ORCPT ); Wed, 6 Apr 2022 14:08:04 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A5760140DFA; Wed, 6 Apr 2022 09:46:24 -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 8C95C23A; Wed, 6 Apr 2022 09:46:24 -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 DF4B73F73B; Wed, 6 Apr 2022 09:46:23 -0700 (PDT) From: James Morse To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Morse , Catalin Marinas Subject: [stable:PATCH v4.9.309 25/43] arm64: entry.S: Add ventry overflow sanity checks Date: Wed, 6 Apr 2022 17:45:28 +0100 Message-Id: <20220406164546.1888528-25-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220406164546.1888528-1-james.morse@arm.com> References: <0220406164217.1888053-1-james.morse@arm.com> <20220406164546.1888528-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 ca978d7d98eb..0414b0494dd3 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -74,6 +74,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 @@ -89,6 +90,7 @@ alternative_else_nop_endif sub sp, sp, #S_FRAME_SIZE b el\()\el\()_\label +.org .Lventry_start\@ + 128 // Did we overflow the ventry slot? .endm .macro tramp_alias, dst, sym @@ -935,6 +937,7 @@ __ni_sys_trace: 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