From nobody Wed Nov 13 19:44:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XpYdP66jJz5cVrL; Wed, 13 Nov 2024 19:44:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XpYdP5Yvdz4Dsw; Wed, 13 Nov 2024 19:44:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731527065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o57QcPah4O/3SruVVQVEcje46kR4UFX2TEuGO27+00w=; b=QJzKc1sswcVMR+VpYljOxsmwlsqXQeH7CNJwwN0+mOEOMcsMydfjeSKr95WOtmfShqnDLD HzPtNruMJkAy5KdKtqNuemqgp8cojOvHPx2Vx1FIPi4rfDPK/0GQnNwb1pDVFv2l7AZFFI Fdb93PJzCXPeQFc4jlLqYU2Xe2X4AF5Ys1F8Bm0fLl0uM1IU9SPFv2KDC75mdy1IOn+vNf tGghfj/auW2qLcdiNSaQCWRqL9EVuw0h9oOJC3RP1XNvxI3daZa7GNBzHBqPxgEj5kkyCp k3IMsVpBpcWZX/tLPq4zjgcx5bUCxPGdsOg3adlpNTRcBaBVwr+tbD6M3uCjOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731527065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o57QcPah4O/3SruVVQVEcje46kR4UFX2TEuGO27+00w=; b=rLr+duN7/P9qNaoQ9L4tK1ovpVEBnEleV0kJd/6ShE6tYKlUm30xbvit8cYBnpK6wA4MFW p+C8hcRnmSFYrgbzPMrYZyh6WVLvjqrPavuaAZ1YPZRbBGDuVtj6fXkw1lMxz6t7KUYmcA QrmpvmNkXHCE+3tI5RkojXGlMwddbt4ix64dRok5XhDb0TsUPoS/uc1AUU0CxPnnL06hGe gs14pAyqhgWJ+li4FfNvNrghXIwllb+yZVmNzyhfA1bKhITnTnBAQ4CAs7w2DH8nNrqi5c ikXLegKJYKDAJIx+EtQbV8rY5wHcsypu1pLIRBWXNdv6LLpqJk/3lFFP6xS4dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731527065; a=rsa-sha256; cv=none; b=WuFKdspAky5IZps6SaQkNd+5xymMVstGBvz/8g26LZAHz9Hcx394auYHBOeFVGPDZAiYmg qsYDuRDVANgHyggiM7IPwWVhfe64rnqDbFfZobQyEQ/Dbk7CM7Qr+Fu0OGsl+gzfGC3Iuk FlbE3+Tl34QDn2cPZfBcwClYWihhgGV5H3CpfeJiOe/R7ERr4M2jB0P81pA86C3T+vG1cv DdWrf9pibe1FQtpcLZRet5bqvkYedDqiUhplsZWzQKzVT6uUVxnbqGck9xwopY4sQqpoJW 82v3EBrpZTNPSrNAii4VyOi6NEl0xYdjFTVEpfujb2VT0dWfWvl5E51j1SuABQ== Received: from [IPV6:2601:5c0:4200:b830:e12f:83c9:e3d1:29c8] (unknown [IPv6:2601:5c0:4200:b830:e12f:83c9:e3d1:29c8]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XpYdP3n0ZzJ1K; Wed, 13 Nov 2024 19:44:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <92a05dfe-683c-43d9-bd29-3110e89be275@FreeBSD.org> Date: Wed, 13 Nov 2024 14:44:24 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: e85eaa930862 - main - Have rtld query the page size from the kernel Content-Language: en-US To: Andrew Turner , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202204071438.237Ecn2A012737@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202204071438.237Ecn2A012737@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/7/22 07:38, Andrew Turner wrote: > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e85eaa930862d5b4dc917bc31e8d7254a693635d > > commit e85eaa930862d5b4dc917bc31e8d7254a693635d > Author: Andrew Turner > AuthorDate: 2022-04-04 15:05:40 +0000 > Commit: Andrew Turner > CommitDate: 2022-04-07 14:37:37 +0000 > > Have rtld query the page size from the kernel > > To allow for a dynamic page size on arm64 have the runtime linker > query the kernel for the currentl page size. > > Reviewed by: kib > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D34765 This broke relro handling for rtld. The reason is that init_pagesizes() is called after parsing the program headers for rltd in init_rtld(). As a result, page_size is 0 when rtld_round_page() is called so the relro_size is 0. The RTLD_INIT_EARLY_PAGESIZES case was for ia64, and in the early case it's probably not safe to call sysctl? If it is safe to call sysctl, we could just always init pagesizes early? -- John Baldwin