Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1494154pxb; Fri, 1 Apr 2022 15:27:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ+sqVzWauZuk3K0/CdNFBsk8xfy2pKzsWwyzRIqrdY2isrU5MJWh8MhO5cRW3mvQTk98F X-Received: by 2002:a17:907:7b92:b0:6db:71f1:fc20 with SMTP id ne18-20020a1709077b9200b006db71f1fc20mr1567533ejc.343.1648852058966; Fri, 01 Apr 2022 15:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648852058; cv=none; d=google.com; s=arc-20160816; b=D/L3AO4xOOKoNLBsRCFLcD/bUU6HTJQavuzmYwrPC3xEFX6Hhbf1yMbVRfiZZnRkbh yqSU2V2oZAm8rfSGDU+5UXgBDgrkDzibkkY2QVPd5mUZk/YIYBBjg1bYik6mv3akpERf F/q8VYnaR5XXfSrjV7tp7TuqxZptRRADdMmfyaKRAXvKuCHGstnYmgMsEHBr6u+K3RtR X0vIIFzYdGb7H7FFKZjnVy8tAAJkX725Vb/G2qXAhiUzNS9wIYcUwlCJs4Z0FNkYcfBT h/3Hw6/98XIVpN7E4dlLaYZ0UxGVlW469CXLTbjtqgtNVCsWU061eQRtzujPOQrCfDvI t2/Q== 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=RgZDgOnC4vtc39Y6/C1nMPuj5MJq2vTkk0OFrvwIXps=; b=sOWZAYkizyXEAnwySqI7Dw2WU+kYQKec6XQ4lwKcLJzVQiN3dWWaZSxP0SuM7y2qvI hcbaJEL8wm7IMleMByA1hD1vusAwA48tneQTM67zWDy/QIfF3P2PY6uD2Xhid5U8LZra 0XIdCjv51mWDWKOg3yVVu+EZfDetZ+GQZgqovnLQQahL2126zL03eNI1npkZmFQyqckb 8XHEci7//uan97w0Izx6yTMawRR44GKOWvy7b3Biiq5KjKOPnDG/OY9ZPDt4GP6lHNLb xtQVTMmE92MNKR+EvACMFlZzzzU9zNLt5VVEk8mplPZPHLTnYGlIo83JG/M4Pe6J2OkM BRBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="c5eFM82/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc22-20020a170906f91600b006df76385dd6si2185079ejb.630.2022.04.01.15.27.12; Fri, 01 Apr 2022 15:27:38 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="c5eFM82/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245686AbiDAGlH (ORCPT + 99 others); Fri, 1 Apr 2022 02:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245625AbiDAGkj (ORCPT ); Fri, 1 Apr 2022 02:40:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 307D0265EA2; Thu, 31 Mar 2022 23:37:43 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BC4DD61166; Fri, 1 Apr 2022 06:37:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDC0BC340EE; Fri, 1 Apr 2022 06:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648795062; bh=414OsYhcHiLq33cLt18rvojc+oh3UKjWGtO30u65hwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c5eFM82/FuxmKz0hrLP1cUJP+2pIjw7Ai42D7aT6eTix3Nr3gTm7iZwBWzoa5OCur yRxcJWLuI/D56f3y7y+cDTkR20fwoytT55EU5uSRjKc0W1j5CVmAHx95n6u+6v/PJd cSrBiax1syMNccf6AQXhOhNhav8NwBKIo1e0+zJg= 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 Subject: [PATCH 4.14 09/27] arm64: entry.S: Add ventry overflow sanity checks Date: Fri, 1 Apr 2022 08:36:19 +0200 Message-Id: <20220401063624.498215631@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220401063624.232282121@linuxfoundation.org> References: <20220401063624.232282121@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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: Greg Kroah-Hartman --- arch/arm64/kernel/entry.S | 3 +++ 1 file changed, 3 insertions(+) --- 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 @@ -131,6 +132,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 @@ -1036,6 +1038,7 @@ alternative_insn isb, nop, ARM64_WORKARO add x30, x30, #(1b - tramp_vectors) isb ret +.org 1b + 128 // Did we overflow the ventry slot? .endm .macro tramp_exit, regsize = 64