From nobody Tue Sep 30 13:56:06 2025 X-Original-To: dev-commits-src-main@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 4cbfjN0BHLz697hx; Tue, 30 Sep 2025 13:56:08 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cbfjM6lRKz4817; Tue, 30 Sep 2025 13:56:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759240568; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0Ye/nS8/iMi4iVRHB481BxGu9dmGBgXG+6TMWSyaOE=; b=p08eBm/77sPqnYik+vGA1W1oUQwE5PSIGOAKu+6sMcMTJYj7efxmFq30H1FKfCI1SbwMlr 17Xgfry48kmd7s2phJUmGvVgPtTRIRNbt91W5zzafSzCullI/3uDclwe+0WolaRu3+j+8v eDT3nSJbhkCBPTn2BENRYiOi6huUpQufGmJ+86PEcrdYGwc6nSKdvBb6mxDrMK1ysR1Xrn waZgz2SNFXa/MiK9te6C7fiD1XnrCEjeIwTz3+k3ThQFWJJFCe3oGS3uZGCVuxHz7/eRxF RXuwXwAx5merYCm+UXCBxE0hg0qPR1qjn3wuZTttbZvFrA0QA5Z5E59OYBnhzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759240568; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0Ye/nS8/iMi4iVRHB481BxGu9dmGBgXG+6TMWSyaOE=; b=EDFd5/vZaEqiQozariTfeg83YhsIt0xdUuAa33oO2Jn/r0EMMc1/Jy8rFlJ/XHAbBi5rz4 UDtKzACxlPJeUHug2Vk5iohoFwUx9DaIwE3uetN5fx487JzwtgcqbAxvf54W8pIY0ZlXr+ DuP2BYaSE/kXMODTv7KsqE6aYuZ8on8V2wu0casBImkC5mp6g5NyN8hVeGs2pCtwvBIJ2C WwazZ1bnE3dRmPiL/C0E5S33exU4l7MgFNsd+vGkSv7bUwjUSh0rj59GTqb2yH8S+zRxO3 1DiqgmQHfS4iI1NMwS92QUj6bq8gFgkERfLsD0LoFfwesQk/TbyOiAtv8LdJGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759240568; a=rsa-sha256; cv=none; b=nN9ds+sReCYtzx10m2B4Da6fG7/ovK5eAb1RIJhM5wkhGBxDQnECvVgBNeSzgBYutSYImp PlJb7bshfLutW7XL/7BHaFXGphpwWVilIEMOeV6BFKSG1J6N2Y0vX6Xd5+nLKWMNe+Ni+Q seAsd5+vrD1R8yDERIpl+KX1A4Gn9wDlOPeDv878HTo5n/Uwys4Q7gbU94VeKg65Ork2u/ 4QsWjnDm9EtxXsT2ouc0SopP+476aYU6TOToUlKzbpQzdHPhs5/toxDKG7PJsd4Kgm4zH2 +qFAxfciO0dqJM4cLvamcQtegLJpwPw+1REBN3Zv/TS+k2nVsFnkOypuzThZqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4202:5670:a58c:4b56:81a5:e4ee] (unknown [IPv6:2601:5c0:4202:5670:a58c:4b56:81a5:e4ee]) (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 4cbfjM4XHjzvRS; Tue, 30 Sep 2025 13:56:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 30 Sep 2025 09:56:06 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: d58339f39874 - main - tzcode: Drop libc namespace Content-Language: en-US To: Konstantin Belousov , =?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202509271707.58RH7ajb090983@gitrepo.freebsd.org> <86frc6bzcm.fsf@ltc.des.dev> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 9/28/25 20:59, Konstantin Belousov wrote: > On Sun, Sep 28, 2025 at 01:17:29PM +0200, Dag-Erling Smørgrav wrote: >> Konstantin Belousov writes: >>> It does change the behavior. Now a user-provided open/fstat/pthread_* >>> functions can interpose the system functions, making tz code doing something >>> that was not intended. >>> >>> In other words, namespacing guaranteed that tzcode was not affected by >>> the app playing with libc namespace. >> >> That is a side effect of namespace.h but not its original purpose, which >> was to allow libc to call pthread functions, which would be stubbed out >> when libc_r was not loaded. This is no longer needed, and namespace.h >> has bitrotted and is missing a bunch of syscalls and functions >> (including nearly every *at() system call, with the sole exception of >> openat()). > Well, this is same as the biology: most features current uses have nothing > to do with the cause of its appearance. > > But still, I think we should decide if we want to keep this guarantee of > the libc semantic in presence of user interposing. Then we can either > fix the missing overrides or drop the feature altogether. > > For ELF, I believe that we can implement this resilience to interposing > much cleaner using protected symbol visibility for symbols exported by > libc. But still, we need to decide what we do. The only trick with protected symbols is that copy relocations don't work correctly, but that only matters for data symbols not functions. FWIW, after my linker talk at EuroBSDCon a few days ago, multiple folks mentioned to me that protected symbols should be used more. One suggested that ELF should even default to "protected" instead of "default" visibility requiring overridable-symbols to be marked as such explicitly. However, protected symbols for functions is a fairly clean fix that doesn't depend on namespace mangling or inline assembly hacks, etc. -- John Baldwin