Date: Mon, 29 Sep 2025 03:59:03 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= <des@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d58339f39874 - main - tzcode: Drop libc namespace Message-ID: <aNnZ1yPIMwzlyxCt@kib.kiev.ua> In-Reply-To: <86frc6bzcm.fsf@ltc.des.dev> References: <202509271707.58RH7ajb090983@gitrepo.freebsd.org> <aNhIKDCDJKWZbTqt@kib.kiev.ua> <86frc6bzcm.fsf@ltc.des.dev>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 28, 2025 at 01:17:29PM +0200, Dag-Erling Smørgrav wrote: > Konstantin Belousov <kostikbel@gmail.com> 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. Not all symbols can be protected: e.g. ability to preempt malloc/free is crusial for third-party malloc implementations. > If we really want to do what you suggest, there are better > ways (like what macOS does). I have no idea about MacOS/what is used by Mach-O. Can you provide some hints or links, please?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aNnZ1yPIMwzlyxCt>