Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2556371rdh; Mon, 30 Oct 2023 00:01:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtKOzmr+/DuvRnGHj/gehaDJjSWdm1Gfyh8j9ZRNY2zAQW0sJUtOCnYbx4/JI3xDCr6Wkd X-Received: by 2002:a17:903:1207:b0:1cc:5378:6a56 with SMTP id l7-20020a170903120700b001cc53786a56mr720680plh.48.1698649318542; Mon, 30 Oct 2023 00:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698649318; cv=none; d=google.com; s=arc-20160816; b=ayepCIr9w4WamKPGjbvyfKRYHyINS92NujKPHme55rFF5Sw4LTqP3bo2NgKFNCCf2W u7JRbnfFl1C3WZewdfB3yqqtKaNLRV4dqUBc7JIjoNIvEM5BGov2A75GOKRg28+idtaU ApVkvezz2tOLHBXLWU5njvdFbQDYHQ/y/m9dXmf+z1P6lGnAo3hRh8TPjfzAMhWCycVs m5s/AmWIJiwXo9xZJcMz3GY1zG53dp3B/RYS3EQRoOlTUOW5UhQYR0b8n9RMuJyHsuEF Uk0KRD70S6oR8TIR4VRxmdVtsL1u+gDCfGTCI+FyjlJTVmbiEkPbelznBq+VQzjQpWq5 fwKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e3bej7js+WiYJ2IL037kP9HpP1iK20/8aPzEtMXCGeI=; fh=ngP2hO7HOj4pNrD5gT3RGdDlwE7RhkgTMDM0O8CMnI0=; b=XiM5xnxKMlzA/0B+lUMDw9QTOr8ZgnByTPdjzuAuDkwRGiACUhZ6GsFOkvZbPtFshV jSdqZK+wdW0WiZQ5d3P7jQv0ue8r9wL0O0DogkksCz+lpTEpeC+MH6lp2xLRz1KjYimW fEwqri/aWXKg47pdZDQPXxCCuF1XsiGIBAoq8Ov/IHsV6qK47EGvZdS6Xenc3MttW/TJ Ck7xHinmZaH97UtdDN5BBI+JNTm51rr4CLyuI2JobRpVXUBtCnn8wn7YHj8aolzDJinm IRG6BJSYWWXsAvRoKhuxW96SdohlFApkXMSIKNxaarRxUCNVsmpCmMww2G9CTWBnd5zG Qt6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fyer+0uy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q8-20020a170902dac800b001cc49532e84si1335162plx.634.2023.10.30.00.01.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 00:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fyer+0uy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1B27880532E1; Mon, 30 Oct 2023 00:01:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231545AbjJ3HBS (ORCPT + 99 others); Mon, 30 Oct 2023 03:01:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjJ3HBQ (ORCPT ); Mon, 30 Oct 2023 03:01:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B19191; Mon, 30 Oct 2023 00:01:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30B1CC433C7; Mon, 30 Oct 2023 07:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698649274; bh=EmJn7V2xcCxlebppxaDAhU12OFutDZWRBy0vMaSrWuA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fyer+0uyv1jhu2jxdwK+n1O2/sIgGI7ezOwxQC871hHJ3Cd/JKl9lBlO3pXltUpO2 tybWUbFkw8nG3yYnKj5NWsk/KsMeh5cYt2Zf06cFoE4cK0SwwSOQ0meQsCZJmwrLES ZjfIwnoeXu/25/54cCJrG0ThSOL/VsSYVOr1W/9QTaMgDvrgblTvcHPZrDSbxEy8fw AT95UrDI+b348FRlIe6JpCkizTZtGaE3kNe+nAOZWv5ZyGWJevSARlVxf0OsNjI/Uk BM7kNTKVl9T3dS3d/hE9ctd5XEbBUeRh4TuIA6DuyqF/4ni+SgBncpCAAQy/vXTAcB 87xr+yc2RIXWg== Date: Mon, 30 Oct 2023 09:00:53 +0200 From: Mike Rapoport To: Will Deacon Cc: linux-kernel@vger.kernel.org, Andrew Morton , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Catalin Marinas , Christophe Leroy , "David S. Miller" , Dinh Nguyen , Heiko Carstens , Helge Deller , Huacai Chen , Kent Overstreet , Luis Chamberlain , Mark Rutland , Michael Ellerman , Nadav Amit , "Naveen N. Rao" , Palmer Dabbelt , Puranjay Mohan , Rick Edgecombe , Russell King , Song Liu , Steven Rostedt , Thomas Bogendoerfer , Thomas Gleixner , bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, netdev@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v3 04/13] mm/execmem, arch: convert remaining overrides of module_alloc to execmem Message-ID: <20231030070053.GL2824@kernel.org> References: <20230918072955.2507221-1-rppt@kernel.org> <20230918072955.2507221-5-rppt@kernel.org> <20231023171420.GA4041@willie-the-truck> <20231026085800.GK2824@kernel.org> <20231026102438.GA6924@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231026102438.GA6924@willie-the-truck> X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 30 Oct 2023 00:01:49 -0700 (PDT) On Thu, Oct 26, 2023 at 11:24:39AM +0100, Will Deacon wrote: > On Thu, Oct 26, 2023 at 11:58:00AM +0300, Mike Rapoport wrote: > > On Mon, Oct 23, 2023 at 06:14:20PM +0100, Will Deacon wrote: > > > On Mon, Sep 18, 2023 at 10:29:46AM +0300, Mike Rapoport wrote: > > > > diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c > > > > index dd851297596e..cd6320de1c54 100644 > > > > --- a/arch/arm64/kernel/module.c > > > > +++ b/arch/arm64/kernel/module.c ... > > > > - if (module_direct_base) { > > > > - p = __vmalloc_node_range(size, MODULE_ALIGN, > > > > - module_direct_base, > > > > - module_direct_base + SZ_128M, > > > > - GFP_KERNEL | __GFP_NOWARN, > > > > - PAGE_KERNEL, 0, NUMA_NO_NODE, > > > > - __builtin_return_address(0)); > > > > - } > > > > + module_init_limits(); > > > > > > Hmm, this used to be run from subsys_initcall(), but now you're running > > > it _really_ early, before random_init(), so randomization of the module > > > space is no longer going to be very random if we don't have early entropy > > > from the firmware or the CPU, which is likely to be the case on most SoCs. > > > > Well, it will be as random as KASLR. Won't that be enough? > > I don't think that's true -- we have the 'kaslr-seed' property for KASLR, > but I'm not seeing anything like that for the module randomisation and I > also don't see why we need to set these limits so early. x86 needs execmem initialized before ftrace_init() so I thought it would be best to setup execmem along with most of MM in mm_core_init(). I'll move execmem initialization for !x86 to a later point, say core_initcall. > Will -- Sincerely yours, Mike.