Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2527731rdb; Fri, 8 Dec 2023 10:35:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnM/dxMMYKim666oXIaYaqV8bKJNP03NXNEje1yi34x8iysqVj3ZsQDt/TP17lxHXs5E5u X-Received: by 2002:a92:ca4a:0:b0:35d:59a2:bb6 with SMTP id q10-20020a92ca4a000000b0035d59a20bb6mr618800ilo.76.1702060546159; Fri, 08 Dec 2023 10:35:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702060546; cv=none; d=google.com; s=arc-20160816; b=NZXuN1cER+5Xa3mMXXEYdcjQeuU3mGEfeG5eFlqIrS10Lwaz2N3usiuAXvMndXV6jJ QvSqc0MQdAfyvbpDJXhkiLyiYqvasWDf4NYFTc/6qPBFCltbxi/9bxwoDuN5ONPHZTt/ R8YzJeFJk1sjQajolyRbT0aCxQdZgs33SeOBBtsN1YKQRfyAiSCJZnnNLPZ/4npdziXG OpkBb6OFmU1jpEOG8UfSiTHfctjdkbHLb6yua5dWkOFEbKC01K24FUUMaHgmm8xQGZ1a opl5bPl0/PEr5Pe1yZ6chd4yhU5faGgz9Zq/a0Ww/H0FineB5m8UGAFmkms80oa2hAEA jCrQ== 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=O4wJSXXt5neot2flp1x6zxgWM58LefvpkGHJupVSw+E=; fh=THZonQ8Hy4gQHgskaqUGWmNFrndb5Yx7j5cJewtDowI=; b=UJWaF5GZjekNHabUq+1Zg4dT36rHfJ5sXt8M+CuUBcjWhWhHwZy5I2enSLFH96WYWx +Ww7bmWVPhnry12QWwGUdnADKP32yAUsViAxr7bJF83jVFgwIH8GoHxMaYVjgQQRGXcI gIJCt+1XG0HSitaRcpkyt1B7cLnT3nccs6s90p2Mx01FNG0r3wC/rzxCgyKXn/nfTjEO vhszPN3lXSw9JrtjShL8bM+WwGdWxa2W3Y8GWOppzOHA4ekvKUmjGugwA8/ro2r3ianz eDGs904GprFWv42sJD3V1jINwYK6p9MjMv9i1XQRnf0CQUqvTSjoJwtsazvA+hLHNygF mkBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YyQv3B3A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u2-20020a63df02000000b005898d648224si1953799pgg.12.2023.12.08.10.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 10:35:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YyQv3B3A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id D68A685A0411; Fri, 8 Dec 2023 10:35:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574615AbjLHSf3 (ORCPT + 99 others); Fri, 8 Dec 2023 13:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233827AbjLHSf0 (ORCPT ); Fri, 8 Dec 2023 13:35:26 -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 33387D6D for ; Fri, 8 Dec 2023 10:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702060532; 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=O4wJSXXt5neot2flp1x6zxgWM58LefvpkGHJupVSw+E=; b=YyQv3B3A05q6vCzrJ2952MwuECs2zWVVwt7hFW3GkeGZO5N5vVqtyN21glSSsfdqvxwS7G zYOVJ04cC4/Us55AksIWIPdYewthgXJvGhidovI2SaZX1Cuq7UvHBVgQ139OTRGiKVQicQ n1Z6hoyKtywuGXUYOhVlx4J2ancHHeg= 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-125-gmoEQhd6N3KHZ7niw_I7xw-1; Fri, 08 Dec 2023 13:35:29 -0500 X-MC-Unique: gmoEQhd6N3KHZ7niw_I7xw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 B577A845DC1; Fri, 8 Dec 2023 18:35:28 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 38C3C3C2E; Fri, 8 Dec 2023 18:35:27 +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> <4f5f29d4-9c50-453c-8ad3-03a92fed192e@p183> <202312081027.BA44B7B3@keescook> Date: Fri, 08 Dec 2023 19:35:25 +0100 In-Reply-To: <202312081027.BA44B7B3@keescook> (Kees Cook's message of "Fri, 8 Dec 2023 10:29:25 -0800") Message-ID: <87lea4czki.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.1 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 10:35:44 -0800 (PST) * Kees Cook: > I significantly prefer APIs not being arch-specific, so I'd prefer we > always include AT_PAGE_SHIFT_MASK. For an architecture that doesn't > define its own ARCH_AT_PAGE_SHIFT_MASK, it's not _inaccurate_ to report > 1 << PAGE_SHIFT, but it might be incomplete. The downside is that as an application programmer, I have to go and chase for the information the legacy way if I encounter getauxval(AT_PAGE_SHIFT_MASK) == getpagesize() for a longer time because the interface does not signal the absence of any extended page sizes. Thanks, Florian