Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1254616rdb; Wed, 6 Dec 2023 13:06:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IECtPsaCC3d2urds1rGwxp+uAZHMZrFUYl9VWzWc/1iO5OUlflUBhOJIhmM670Ms+gN7ofI X-Received: by 2002:a05:6a00:2388:b0:6ce:2731:d5d2 with SMTP id f8-20020a056a00238800b006ce2731d5d2mr1369707pfc.67.1701896764087; Wed, 06 Dec 2023 13:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701896764; cv=none; d=google.com; s=arc-20160816; b=R2euB1iVw/pcScCHvSz9EAl3xa4XsJkw0YEzfwbp9WBFlEKskg0ODKFomnnILhcSXg X81PEy3JC7VcdoM/gMvWrqb8vjqBXoEMJ3lnyFAwbX7MMeN2pN9es7qWEf/P+DOodnh/ kCf037gSoB47EyyUJxS0HFekI3v4Br72y2f3mjxjyYM+Hoe4yVNgEBSrP+fXWcWXV/By TUY9QEnuCMpxiCyvl9I5n2sM+SNovxkj6yR/eWeH7t/alcmItW7GkkcRp1/GSyhxqX1T X9pamqEvDjx0/w+m+JC2AxqdMmpNyWx0BjtkGkrgkVmfDilynqtl5jv/bp9BjC+aBLTR UIyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=ZutLjg4ZrXSy0kTMsgMWzWoflkvk2VdU4Om/vjd4igU=; fh=THZonQ8Hy4gQHgskaqUGWmNFrndb5Yx7j5cJewtDowI=; b=UH0Ayue6uzaWBt+zZBQSa0EffXzFLz/c9NNFc94xlqhTWu8bBzjMH7m4S75/DyOtwv eyL7qMg7qcEPW8QOCvDQXOeXCEG0V/6hZkgObnV6SVyACHM2Ym5/e2pCJHSecwPY7dlt /M5pBUZk1LklqXM3tsICOdSbnm22KxXZZcf6/4eW2gP9WKEYRwRp7TTvUvppbZxlRZ8P /RtzaXcvAgjlpAgMjAnaOtMVMqWC+iv8NuVW32Wpjy5cr2Kiba+/pzM1EB/zTqxLTERq jAjvh4+qEr2cAS1UXYX7EWxK77UFJ2tOQaU1ePhHG2aYD+0jCRXHOUg944WnGy8Bt/WY kLuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LEVwRCyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g13-20020a6544cd000000b005c677224c92si450231pgs.522.2023.12.06.13.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 13:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LEVwRCyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B42DD807F4B0; Wed, 6 Dec 2023 13:06:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379608AbjLFVFo (ORCPT + 99 others); Wed, 6 Dec 2023 16:05:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379748AbjLFVFl (ORCPT ); Wed, 6 Dec 2023 16:05:41 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E05AD5C for ; Wed, 6 Dec 2023 13:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701896746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZutLjg4ZrXSy0kTMsgMWzWoflkvk2VdU4Om/vjd4igU=; b=LEVwRCyCYEMIldC9oYQXg/DQQWdSagM322xsK+PapOgsC18oMiKEuWfVuhlQN2Sz7TQRF0 /Okb54yIjfaAZMOwukJ+e5ngPdwBzLWhVqPzUFX16yv79JPDaTSetm2QsAqmMy+SL9liFV 1XOSURfR+/ehrZTrRKTd3IpvHH0qSU4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-ys5jfklFPL-HBOzOC9AXQg-1; Wed, 06 Dec 2023 16:05:41 -0500 X-MC-Unique: ys5jfklFPL-HBOzOC9AXQg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8EBB48493EA; Wed, 6 Dec 2023 21:05:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B06728174; Wed, 6 Dec 2023 21:05:38 +0000 (UTC) From: Florian Weimer To: Kees Cook Cc: Alexey Dobriyan , Andrew Morton , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2] ELF: supply userspace with available page shifts (AT_PAGE_SHIFT_MASK) References: <6b399b86-a478-48b0-92a1-25240a8ede54@p183> <87v89dvuxg.fsf@oldenburg.str.redhat.com> <1d679805-8a82-44a4-ba14-49d4f28ff597@p183> <202312061236.DE847C52AA@keescook> Date: Wed, 06 Dec 2023 22:05:36 +0100 In-Reply-To: <202312061236.DE847C52AA@keescook> (Kees Cook's message of "Wed, 6 Dec 2023 12:47:27 -0800") Message-ID: <87edfzavof.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Wed, 06 Dec 2023 13:06:00 -0800 (PST) * Kees Cook: > On Tue, Dec 05, 2023 at 07:01:34PM +0300, Alexey Dobriyan wrote: >> Report available page shifts in arch independent manner, so that >> userspace developers won't have to parse /proc/cpuinfo hunting >> for arch specific strings: >> >> Note! >> >> This is strictly for userspace, if some page size is shutdown due >> to kernel command line option or CPU bug workaround, than is must not >> be reported in aux vector! > > Given Florian in CC, I assume this is something glibc would like to be > using? Please mention this in the commit log. Nope, I just wrote a random drive-by comment on the first version. >> x86_64 machine with 1 GiB pages: >> >> 00000030 06 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 >> 00000040 1d 00 00 00 00 00 00 00 00 10 20 40 00 00 00 00 >> >> x86_64 machine with 2 MiB pages only: >> >> 00000030 06 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 >> 00000040 1d 00 00 00 00 00 00 00 00 10 20 00 00 00 00 00 >> >> AT_PAGESZ is always 4096 which is not that interesting. > > That's not always true. For example, see arm64: > arch/arm64/include/asm/elf.h:#define ELF_EXEC_PAGESIZE PAGE_SIZE I'm pretty sure the comment refers to the x86-64 situation. 8-) > I'm not actually sure why x86 forces it to 4096. I'd need to go look > through the history there. On x86-64, page size 4096 is architectural. Likewise on s390x and a few other architectures. Thanks, Florian