Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1364848pxb; Wed, 6 Apr 2022 16:29:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVER14gDxuwFyGslv8uFsNh3dZItKlACzYB0zRDJ6WNXoZ6IHEO8Mpv9Otz4p6g1IauXdr X-Received: by 2002:a17:90a:6945:b0:1cb:f39:5096 with SMTP id j5-20020a17090a694500b001cb0f395096mr1063006pjm.42.1649287770561; Wed, 06 Apr 2022 16:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649287770; cv=none; d=google.com; s=arc-20160816; b=y+difGy5IJv69gsm2uae8iqSQlCehpsiWkEO3/QZRY8B+l8xt433i7p2p0M+nkcuTC PjgPVPlNjCG7cH9ab/us5vPq5sQL66xsdNiDE3EASrT/X0684WAzK68R6NMZ1P42eEii kpZQcvYksABLInKHHgEyx3cWArN0byjGtqOBVn8WkoH9gVHwYyjiOHWROnsUb8Xa1JSC S3AKOLkIXZpK9Shbt6vagtdgvC4NkTDv2fhqsym6TwUMKiNIFplqTlu20XJHYAHM8XQ/ 7zvMZoMqjDJj+uwxB7roO1cAMVXgFxP9WojlEq9co+rlikl/whVhZTCJQLqulei2P73T GmVA== 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=v7Cs34eS/N2D5wOFrYb12fnczt3Bbi0yDVSya4hiORg=; b=vTHjlAxJY2GIwE7b+i6XqbZ9eNTKCBOdG1qyluVqGV9SlA/hhLexJfzq/bh8SCYxzu 9DjTJoQ2zJr+GF39saxm1177PbmeOsaI+aFK8eu5YN1x2Ro6gnBXt/fG+sSJ4/rcyHND 3K3DJRA7qO/8cJtkEpERfZ5CBsnRNuV5OHhibiIBALySPm2FiBRrxQSfexno+Vh/sXSj E207wpSY5M86tLV1mtjfghz8mzqQ/TqaTFCS1ZNMixfvH2WnmeMNOvPV3tIb/LRo19dP P7nMUwC+6NgXVTKjxZFZrBUkC+Q8N1HnYfKGaZ/B58THAy4ASEkQFg0u5tkJ4smPY1AV PspQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tECjaeMW; 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 k12-20020a170902ce0c00b00153b2d164a3si16788982plg.171.2022.04.06.16.29.16; Wed, 06 Apr 2022 16:29:30 -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=tECjaeMW; 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 S234261AbiDFUVL (ORCPT + 99 others); Wed, 6 Apr 2022 16:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233807AbiDFUUa (ORCPT ); Wed, 6 Apr 2022 16:20:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6414160479; Wed, 6 Apr 2022 11:27:50 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8DB83B8252B; Wed, 6 Apr 2022 18:27:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB5EBC385A3; Wed, 6 Apr 2022 18:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649269668; bh=ms8DKPPccNuD/4jD9tYlkCtvQOsvj2iMy99LDZoFne0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tECjaeMWJVhvD1ZrPngkjdOpHGVI3P0deLy3p/SIN1L6nsdIeFIRg5vwa2uZOby7m pd9juI/Gol2JmljNxVQVY31bL1m6My/IA344q2loFh5udMp5xR9mKePBoMyNweBYTg 95n66KAyckyEOY5vZIgoOgMP8e3v1/1FIcwxVW1Q= 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.9 25/43] arm64: entry.S: Add ventry overflow sanity checks Date: Wed, 6 Apr 2022 20:26:34 +0200 Message-Id: <20220406182437.412264208@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220406182436.675069715@linuxfoundation.org> References: <20220406182436.675069715@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 @@ -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