Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1646461pxp; Thu, 17 Mar 2022 13:31:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Qud1JQ8AP3TKJndpBGiepaHAmEyo2tLqcXfrpQE0GejPvuGISKUlKGlM0oTno0TQMZLZ X-Received: by 2002:a63:2d07:0:b0:381:e49:ae0c with SMTP id t7-20020a632d07000000b003810e49ae0cmr5069781pgt.261.1647549078010; Thu, 17 Mar 2022 13:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647549078; cv=none; d=google.com; s=arc-20160816; b=hLKoLIr5/M25G2U60g/uxN3WD8ER08uewUXL7WdTVvdpkl1Jh20eEC+1ByaeoVM/Aq nfpQohieReLv21KQMeGQwc9/oHoeTVQW5wEkKRu2pQh2qILa1lhGZLdCEYZZPBSPyk6/ x5JVTrE2tw7c4/pE4nOXtEP07UD4KdNrBntrR6yCduhw6JdK2B7I6wXrnqe3nPrrGREU PynYRUM4/CVOfLOLGmSM/uDhNvRFL4JpAoPn6pvZDnQi2hzshC6i3/V38BTRCxCVMyD9 MuPBNlicUMHdQIuUP635PdLxC79xx9By+qJd3Bmx/ODpsUAM6pjPiEOXawFrwDvSoAWm /Ujw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oRu98ib2Bx8qdIWeISljP9UvNz9rGics+QuKO3FBEyo=; b=cMeljjr0JJLfc/XkIrROw2cKSChaJN+6coJpqlG9lApJaiGGfyCFFEZYzo6Ty7wqVT gSqRl/rTSHPVW5/tdC/lTmpvL+OumlDqC8O8rL0/9ilxDzV1uh3wRID54vXoVzGN4xcF ni9udkR4qkp5K1QzTsavZzWXXppvuwGc/vEduLdhW8K+Rh30Le5eI9beJipmUm8PZkqP fvTmCCqiQx7QBaM1P5wTufIWQJA8c4Pf0Y0mMIewr5JejyZawFxuWzd76GWQCMLB8Wig 8OV5eyLpkZ3G6F9adziUjnGZg11xMv6zsWp9J2ZUrzm27H4y65NHOpQaTjym0EaBBzfo 8fFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oZUILlLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j134-20020a636e8c000000b003816043ee52si3190197pgc.71.2022.03.17.13.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oZUILlLU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 697AA2D0B1A; Thu, 17 Mar 2022 13:06:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233979AbiCQMv0 (ORCPT + 99 others); Thu, 17 Mar 2022 08:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233875AbiCQMus (ORCPT ); Thu, 17 Mar 2022 08:50:48 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA96B1F1268; Thu, 17 Mar 2022 05:48:48 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id B529ACE2340; Thu, 17 Mar 2022 12:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9871C340EF; Thu, 17 Mar 2022 12:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647521325; bh=Je/pA2Sy+kXVvNl4bpYDV7LbuIOUj5G9SKzbyZ809nI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oZUILlLUEYTGycSWsbkWPvqA4m+x9J/z7yIgsrgAQ/wdOydZSMmPapYxtBvSgSesL MdY0a4gUsDk90xp0dfusEO5ADlnkpoMEtCt2vJRuCNNGBXmNik4TbrvGxvuLT3ugKF EZTw4vmzFrtjaQslPDleBpMTh4oWV5CAXXYFilWA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Russell King (Oracle)" , Catalin Marinas , James Morse , Sasha Levin Subject: [PATCH 5.4 07/43] arm64: entry.S: Add ventry overflow sanity checks Date: Thu, 17 Mar 2022 13:45:18 +0100 Message-Id: <20220317124527.880404363@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317124527.672236844@linuxfoundation.org> References: <20220317124527.672236844@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: James Morse 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 Signed-off-by: Sasha Levin --- 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 db137746c6fa..98991aa9d0b1 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -59,6 +59,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 @@ -116,6 +117,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 @@ -1080,6 +1082,7 @@ alternative_else_nop_endif add x30, x30, #(1b - tramp_vectors) isb ret +.org 1b + 128 // Did we overflow the ventry slot? .endm .macro tramp_exit, regsize = 64 -- 2.34.1