Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2157713pxb; Thu, 3 Feb 2022 00:01:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrwJXEE24Xh70tRe1Aft+aiUekoRn64QY3BHf0sp9DXxIndca1i0tjEpSSt1T3nA+Txw1r X-Received: by 2002:a17:902:c206:: with SMTP id 6mr35195093pll.46.1643875308370; Thu, 03 Feb 2022 00:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643875308; cv=none; d=google.com; s=arc-20160816; b=p9aMiIFI4W3Z/AkLJPGiL2GZJDemsHJ/pIgAsMPNuqGGT02cqJJo6KUP1jnUv7KbKh Skm7Fzc27fe248GFa+2AZXF570SRWirkFoKPZKYzzATy0VNhMnP6gp7+roemcu3nNNZS NdNUV3LlQGiNv3uEv9AZlvXjASsf0foTErbIqbqzmatC+h/VwKeh/Pv8fLjkKZ34gwbo DKgtI+0C5JD8r9c4T5fYrRQeuS/eKpNpqI3yP0l0SLyhsGndXYIqnRggllFZZ0YhMB/B QvKYkKBnPSHUZ+TbtepUClkBIaE72MLP5jo23v0z8SyrNyOIWy6BfQyH5cy8Zb3b+5Uf Z5SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=sKMSro+nqi3+TRaInDh/r5jt9h3R6I+1JvbqLUuQ9zw=; b=LqhtyXaTYzorOpKmO6tt5v+vzTamAEk0tM+02IF38o8T/aeOnVu0HhVlCMTvRqv3M5 PkWVoWJ4ljgCcBQUugccdAmJzh24Duick5SLzKRwVvCzTu1t3cncTr0mfP2Z+R1h1M+U YDR/28En2d4bJwryWzSaxv7OgdDNk9rbH0DWH/JD+gCFOOWn9TgjacerVXSxVSpSl4D7 JACNYZ8irdy5GavyGp3/V56oGn6pqPbp0ZQhRk7hqFiLfngjHKGqE51BdXWC+iLWUtBS yl1J/6H6HOWAJ8I6WBTTIWvwFCNEV6U9mqXmq5ggCP6/zQBgkVXwyLiQiszGtA2q3ZeK sWXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=EQFB7AmH; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16si22159677pfm.13.2022.02.03.00.01.36; Thu, 03 Feb 2022 00:01:48 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=EQFB7AmH; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240495AbiBBXgl (ORCPT + 99 others); Wed, 2 Feb 2022 18:36:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234851AbiBBXgl (ORCPT ); Wed, 2 Feb 2022 18:36:41 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E477C061714; Wed, 2 Feb 2022 15:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=sKMSro+nqi3+TRaInDh/r5jt9h3R6I+1JvbqLUuQ9zw=; b=EQFB7AmHjcEOog2AgXpabrhNbq eb+nIuW++r278MsQm+yo6BJLgWEi7DgA0z/LlXygv3QszEhUFbTZTYEd7tnQF95I9q+HDvddpS0dr ZT4oOJqpMyq2CEFRDI9sNR/0008KH9VEFO6SEXb/UlghtmM1nhzbpJM/5gNt8d05BRv4D8tQ5GrZW fpzQ8SgxsTS6vdNOuRec1F/wQ5pWQ0g4+NAL2ajplTSo5BZ+1fnALWGrFPMSPAfHFWRnsxJ/WmIg1 N3Sh1ZVZn6t5DVK/fZ6Xax5LywKa/tBa8o8JoZbW2WIGkbbwfyxz0e9MK78JgVYWCcygyNJY3ImiP uQFa5xkw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFPAz-00H4rN-PB; Wed, 02 Feb 2022 23:36:37 +0000 Date: Wed, 2 Feb 2022 15:36:37 -0800 From: Luis Chamberlain To: Christophe Leroy Cc: Jessica Yu , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "kgdb-bugreport@lists.sourceforge.net" , "linux-mm@kvack.org" , "linux-arch@vger.kernel.org" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Subject: Re: [PATCH v2 5/5] powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and 8xx Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 11:28:12AM +0000, Christophe Leroy wrote: > book3s/32 and 8xx have a separate area for allocating modules, > defined by MODULES_VADDR / MODULES_END. > > On book3s/32, it is not possible to protect against execution > on a page basis. A full 256M segment is either Exec or NoExec. > The module area is in an Exec segment while vmalloc area is > in a NoExec segment. > > In order to protect module data against execution, select > ARCH_WANTS_MODULES_DATA_IN_VMALLOC. > > For the 8xx (and possibly other 32 bits platform in the future), > there is no such constraint on Exec/NoExec protection, however > there is a critical distance between kernel functions and callers > that needs to remain below 32Mbytes in order to avoid costly > trampolines. By allocating data outside of module area, we > increase the chance for module text to remain within acceptable > distance from kernel core text. > > So select ARCH_WANTS_MODULES_DATA_IN_VMALLOC for 8xx as well. > > Signed-off-by: Christophe Leroy > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras Cc list first and then the SOB. Luis