Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp373096rdb; Sat, 30 Sep 2023 07:45:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHILFzYJ/UIOMUTW+rSOvn9uPh2SnscY5TpiwpZjcV+coKk8DDs5xmvevKTXRMs04P2QRXX X-Received: by 2002:a05:6a00:2d13:b0:68a:5773:6319 with SMTP id fa19-20020a056a002d1300b0068a57736319mr8257032pfb.11.1696085135114; Sat, 30 Sep 2023 07:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696085135; cv=none; d=google.com; s=arc-20160816; b=sk3v7Ct/3H3aAzQleVKYUvLTzaxsA4JC5OK3ulHDjX4jOuo992XLip/o9yGc/krHdV Fm6MgAWE0RjdQyB6DWqB7C0owH/DuHclPO6bNf3rS0i3UJ7VMf7D9vO5iM9WT57yj6KU HfBBI49Ows5cCPY70PpLbzJKbwXd48rYBUAVxdPEGN7uc62exS4R57PNg3P5y5uiQjL9 5EW/h+GFgwdCAfYZ/zM6qKQ6D1E6hJ9Di/+Mof6lk6gCgh/LtzaVXm+KDfO4GGvFLww9 JKFPXTgSITmyids2Xm7/bLxxp6vOelzh4qXXKgYOeK2uRHCnCLy4AD0teK4dniJGa9Jz L0+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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vVD0NwiVgmmQvibC1xInA0otG2T0uniQ4SKhb3BsNQI=; fh=tMA3A9IdU6IS3yLxALqcCsZ0fo4+OSU7WcipPhsjFUs=; b=aE2rtNonob5wjKjZN2UOOE8eByNPo5QZ6v08HA0I58E4Ry+5SGlZm1Dil5UwNbM7kY dvD82ta9nZOYHOchmp2ecLfPN8S6aEW1SCL75Yp0aH+VFcbiSYZhUaHT/tjUZ/ZYCb7Q BTSvu2o4hL5+KiaaRRu6I2SRpMniOjE7xsGnJn3bmwbDljyOOC0YwuunZ8yOFEKNPVsv l0njBOHmhK4oTqVGByBT6wyF6L3i8HR3yJWf3dgdXKBmtWwpnN6QVxANB8TZJ7FcQKsY F5FdbP5shbuipRvWyGqb2OMOjf1oLD1nLI72cOgI2N7vhHCZKaNn6iC/UK3RsDRD96bp /1Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kreCBmuH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id g2-20020a636b02000000b0057e0c5a34f1si19645023pgc.239.2023.09.30.07.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 07:45:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kreCBmuH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CB80C8226F4B; Fri, 29 Sep 2023 15:53:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233179AbjI2WxC (ORCPT + 99 others); Fri, 29 Sep 2023 18:53:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjI2WxB (ORCPT ); Fri, 29 Sep 2023 18:53:01 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0FE8F for ; Fri, 29 Sep 2023 15:52:59 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id ada2fe7eead31-4510182fe69so5892402137.3 for ; Fri, 29 Sep 2023 15:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696027979; x=1696632779; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vVD0NwiVgmmQvibC1xInA0otG2T0uniQ4SKhb3BsNQI=; b=kreCBmuHwoM0nmrl8pqn/+pwIP7Wdy8EYXkChnGvV6aS684fNe00D8pVSiI1ADK9Ky jivRVT19/fSZXnVMLB7FbJcBfBOnE3cYSsmjP3eR6H3DQnCqPWi1RsnBHoB3QVO5Bu9S jk9iepApaGL36AlOg4zSsnWV+9uFXpdvJwahC9QqAn8dpiNEMG2k+dl83QT3AdgKV/DL DrSW0nGZY7vH06cnwWGDAUcQtqbeuHHSiao7tATIXqBAKucZhzyvkkq+CUbCLrkm02zo V+4mLBJM1pVKOlj0pt9zaAZ+HqNUpf7BSew5IxPuWzGjKy4leliKT2vaIjyUmTbnAS7i J51w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696027979; x=1696632779; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vVD0NwiVgmmQvibC1xInA0otG2T0uniQ4SKhb3BsNQI=; b=Kdgfy4YLuY/0RKnnRjlEU4HJmRm6JePor1pH62XvsJs664tD1YHpKEi9NnHUKIH/9B wrfZC3WH58YjE8tQgFw7HdK6NLWtLy8WXigOztAXr9JlY6Y3Rx8iteDcVhlYkmhbyZcz ES0ap5VpUWldIvE41rKYTaTfI46CitpHvR790uvZesdXpiP2MSSRgr3JJzYnae2sBl8J jiA2DvJQ++YKauvZddIMhahNGY6yVLWCiHUqWdEtwp/ZCVd5BfuxSY2BzDJWwRUb5MZn kozjMjhO6h+VnpJdVTVqBENrGQqpxJ7OHDQN9S3bpBF8e8pln1XqykCy6KUZKSKxi2Dw daKQ== X-Gm-Message-State: AOJu0Yy1JeZ6b+ozptLDLFuXy4FJFyUnp4xAD2mcpijVwRvpjiKbIXgu PC7UHI56ekdZI/TMH4DsDv+7OeOeTpmvaz2ISVUprg== X-Received: by 2002:a05:6102:134b:b0:452:77f1:f1e8 with SMTP id j11-20020a056102134b00b0045277f1f1e8mr4849186vsl.33.1696027978754; Fri, 29 Sep 2023 15:52:58 -0700 (PDT) MIME-Version: 1.0 References: <20230929211155.3910949-4-samitolvanen@google.com> <20230929211155.3910949-6-samitolvanen@google.com> <202309291452.66ED9B4D83@keescook> In-Reply-To: <202309291452.66ED9B4D83@keescook> From: Sami Tolvanen Date: Fri, 29 Sep 2023 15:52:22 -0700 Message-ID: Subject: Re: [PATCH 2/2] riscv: mm: Update mmap_rnd_bits_max To: Kees Cook 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 29 Sep 2023 15:53:08 -0700 (PDT) On Fri, Sep 29, 2023 at 2:54=E2=80=AFPM Kees Cook w= rote: > > 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? I haven't seen this elsewhere, but I also haven't looked at all the other architectures that closely. arm64 does something interesting with ARM64_VA_BITS_52, but I think we can still handle that in Kconfig. Sami