Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp48496rdb; Fri, 29 Sep 2023 16:17:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWyGTQ4HQ6gd+yXdIrX5LJzjG+aDCJ1SSZKj1QKqzRzpBo0eAtWSihcySU/Sak3KGqaA34 X-Received: by 2002:a17:902:b282:b0:1c6:15fc:999 with SMTP id u2-20020a170902b28200b001c615fc0999mr4256723plr.45.1696029457894; Fri, 29 Sep 2023 16:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696029457; cv=none; d=google.com; s=arc-20160816; b=T7BYc081RWxJKbqEvLmqPwzT574BVSdABZQD6f+SGtN7Oyb0BHS4/2rLC8bmOf/DR4 LURChf27JbwofTUPpgIu07wBMQlM/1bKA6Et9gDEHvzbpjozbfQbsoBbVsE3Z/nSt5c7 2f9FBpNfmzVEiXki0IwHGfUNng6wychRk7XP4VGi/Cbm1Zj4jeVNUuuQ43tBgM9WiHGx FFLGnJQBwiC+Hk9hqm1J2hX6QQPeIQysRzNn8DRUqh4dcastdJkzkAA+7Pho6NlmUf+0 YixWvcJCy09HdKL7jS2YDJHryzlUc6dixfAebJlVgpumVwvJRcJNnSHGf759pMEP9Ik1 r8TA== 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=MHH0ku3cnEfuovvq4TN+nU7rjq4fes2yQy9ZicPmfy0=; fh=3cy/lLY2ORxHn4SMHuuNfgct5Alepp9lkf119PhXMWs=; b=FKLCjenm80GsWZafdX1fGfXFwAZtqlik7sOPnGBBoYFsowE4cT14w5ynJZ0E1GdtIe JJqvVrYUA1alSrgH1oattXUq5vrmBj3NsErlTzPfAyXspFSdlkQEE4Wkns+Lmpi3TdoN 7/X25w3cuojTiH/HVXtANg69MXpi9KZRMFxbKx/FPHuRVLe1hNClOVz1vCYjm82fHMQ3 5ZaTbL9fk/l/uT3MUtYDXuTW2a6n4a8LFAlX3ntgplz/Nr/TCNxaSlpt+PODGHGuXfue CASjKWkTpWOdYLPlHfw7lgib/KtuY7MKxUZC+1PC8WYALRF+YZ3Y5YQG122E0n1Nd9tD rx7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XdDICizW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d14-20020a170902cece00b001bc674914b0si25248644plg.472.2023.09.29.16.17.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 16:17:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XdDICizW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3E0E18319206; Fri, 29 Sep 2023 14:54:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233862AbjI2VyL (ORCPT + 99 others); Fri, 29 Sep 2023 17:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233739AbjI2VyK (ORCPT ); Fri, 29 Sep 2023 17:54:10 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62EDDEB for ; Fri, 29 Sep 2023 14:54:08 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-27927d37ec7so1449188a91.0 for ; Fri, 29 Sep 2023 14:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696024448; x=1696629248; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MHH0ku3cnEfuovvq4TN+nU7rjq4fes2yQy9ZicPmfy0=; b=XdDICizWyyfUBOGS9Hcy1AaKWGaDIypGxhUi/T+9/Q/RpQsqwPveiS5QSGo4Ffu+io XQyanX5pQ6m4GHWNDjk1Uw1HHiHHfmfTfpX+DAPjV5FL8htsmTJkf1R2UbNh+u49lQ8n WPQLauN5vYq4Yz3ZwTdVNehSn7UInlAhDsK3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696024448; x=1696629248; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MHH0ku3cnEfuovvq4TN+nU7rjq4fes2yQy9ZicPmfy0=; b=r9nqua93DPyDpOnPwRuRapb+o1BSzTboscfXDAt/k7eM1pUbXtIgCHyV55DLZDrrCd F+sJ08rK0BpfDGFLZH3/j+Mn/qLdFQS8Fz7mLxBJgw3y+W7/M3u6WpkUOje4TlAhncI3 inEioc+KjAsnY4NflCknJ5ldGiqXjJ9GVVWkKpk8UGKsJo7bF3rkNB4a+BUfEjMhit5V BS3dmYMYOyr4k6Eq8qONIUcB8+9HQK6O88YtAp+rKpbOSAGUJZPfmmbja5njRE1D27Af gtLyaXLpRyxLAL9N4JQmbQcjo45gBw4Zfq873jibp2Hyw39U8o3cBpORlQ44nhGQgrXc 3UEQ== X-Gm-Message-State: AOJu0YykBKZx6vSGegHi0TNbW19yIDG6kBhodKV5UQ8ZJquGOl1YbSwq Dx/G6yWb+S7nG56VHIv2esB1hPr4lOKfoFdUGzA= X-Received: by 2002:a17:90b:8c6:b0:26d:2bac:a0bb with SMTP id ds6-20020a17090b08c600b0026d2baca0bbmr5064809pjb.6.1696024447861; Fri, 29 Sep 2023 14:54:07 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id 11-20020a17090a004b00b00273fc850342sm2114438pjb.20.2023.09.29.14.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 14:54:07 -0700 (PDT) Date: Fri, 29 Sep 2023 14:54:06 -0700 From: Kees Cook To: Sami Tolvanen Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrew Morton , linux-mm@kvack.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] riscv: mm: Update mmap_rnd_bits_max Message-ID: <202309291452.66ED9B4D83@keescook> References: <20230929211155.3910949-4-samitolvanen@google.com> <20230929211155.3910949-6-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230929211155.3910949-6-samitolvanen@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 14:54:18 -0700 (PDT) On Fri, Sep 29, 2023 at 09:11:58PM +0000, Sami Tolvanen wrote: > ARCH_MMAP_RND_BITS_MAX is based on Sv39, which leaves a few > potential bits of mmap randomness on the table if we end up enabling > 4/5-level paging. Update mmap_rnd_bits_max to take the final address > space size into account. This increases mmap_rnd_bits_max from 24 to > 33 with Sv48/57. > > Signed-off-by: Sami Tolvanen I like this. Is RISCV the only arch where the paging level can be chosen at boot time? Reviewed-by: Kees Cook -- Kees Cook