You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
id: rustix crate bypasses libc breaking LD_PRELOAD based tools #13399
Build with --cfg=use-libc as a workaround. I don't want to do that at upstream for performance if possible.
I think it is fakeroot's bug (lacking support for static musl binary). Is there any chance for fixing fakeroot to use ptrace?
Build with --cfg=use-libc as a workaround. I don't want to do that at upstream for performance if possible.
I think it is fakeroot's bug (lacking support for static musi binary). Is there any chance for fixing fakeroot to use ptrace?
Thanks for the tip! I think that's reasonable – it's a bit of an unnecessary overhead yeah.
I kind of agree that it's fakeroot's bug. I'll check whether we can ergonomically use something like ptrace() instead.
For the time being, we will use rustix with the libc backend on Ubuntu as that currently provides the easiest compatibility for the current tooling. I think we can feel free to close this issue since that is a solution to the problem.
It might be worth to document somewhere for future reference that the migrations to rustix and its linux_raw backend will prevent things like function interposition with libc for uutils coreutils. However I would expect this issue to be quite niche and small since it only affects packages that rely on the LD_PRELOAD hack against libc in conjunction with calling utils that rely on those same functions.
It would definitely be worth documenting that using the linux_raw backend prevents a documented feature like LD_PRELOAD function interposition from working. It’s may well be a niche incompatibility, but LD_PRELOAD is a documented and well-established feature, so users are unlikely to expect this behavior.
On Linux, rustix's raw syscall backend performs the affected calls without entering libc, so an interceptor loaded with LD_PRELOAD never sees them. id uses that backend, and the choice is fixed when the binary is compiled.
The build section of README.md and the packaging guide now explain that this backend skips libc interposition, with fakeroot and id -u as the case that still reports the real UID.
While I really don't like this, I'm fine with using libc at id only since it is easy and fakeroot is widely used. But new apps should not use LD_PRELOAD and we should not support LD_PRELOAD for new apps.
Agreed. Documentation makes the limitation explicit, but it does not make existing fakeroot/LD_PRELOAD workflows work with the linux_raw backend. We should keep this open until we either have a supported compatibility path or decide that using the libc backend for id is the long-term resolution.
Activity
oech3 commentedon Jul 14, 2026
Build with
--cfg=use-libcas a workaround. I don't want to do that at upstream for performance if possible.I think it is
fakeroot's bug (lacking support for static musl binary). Is there any chance for fixingfakerootto use ptrace?BAMF0 commentedon Jul 14, 2026
Thanks for the tip! I think that's reasonable – it's a bit of an unnecessary overhead yeah.
I kind of agree that it's
fakeroot's bug. I'll check whether we can ergonomically use something likeptrace()instead.xtqqczze commentedon Jul 14, 2026
I think we should build with
use-libcby default unless we can demonstrate a measurable performance benefit from using thelinux_rawbackend.oech3 commentedon Jul 14, 2026
xtqqczze commentedon Jul 16, 2026
fakeroot-ngusesptrace(2)instead ofLD_PRELOAD.BAMF0 commentedon Jul 16, 2026
Interesting! I was not aware that
fakeroothad an -ng version. Sadly it seems like it has been removed from the Debian archive.oech3 commentedon Jul 16, 2026
fakerootis actively maintained while-ngis not. I think we should just fixfakerootin the case.BAMF0 commentedon Jul 17, 2026
For the time being, we will use
rustixwith the libc backend on Ubuntu as that currently provides the easiest compatibility for the current tooling. I think we can feel free to close this issue since that is a solution to the problem.It might be worth to document somewhere for future reference that the migrations to
rustixand itslinux_rawbackend will prevent things like function interposition with libc for uutils coreutils. However I would expect this issue to be quite niche and small since it only affects packages that rely on theLD_PRELOADhack against libc in conjunction with calling utils that rely on those same functions.xtqqczze commentedon Jul 17, 2026
It would definitely be worth documenting that using the
linux_rawbackend prevents a documented feature likeLD_PRELOADfunction interposition from working. It’s may well be a niche incompatibility, butLD_PRELOADis a documented and well-established feature, so users are unlikely to expect this behavior.oech3 commentedon Sep 30, 2026
related: #7967 (which is more serious and mostly impossible to fix at both of our side and other utils's side).
mvanhorn commentedon Oct 12, 2026
On Linux, rustix's raw syscall backend performs the affected calls without entering libc, so an interceptor loaded with LD_PRELOAD never sees them.
iduses that backend, and the choice is fixed when the binary is compiled.The build section of README.md and the packaging guide now explain that this backend skips libc interposition, with fakeroot and
id -uas the case that still reports the real UID.#15261
oech3 commentedon Oct 12, 2026
While I really don't like this, I'm fine with using
libcatidonly since it is easy andfakerootis widely used. But new apps should not useLD_PRELOADand we should not supportLD_PRELOADfor new apps.docs: document id rustix LD_PRELOAD compatibility
oech3 commentedon Oct 17, 2026
I'm not sure if we can close this just by doc.
mvanhorn commentedon Oct 17, 2026
Agreed. Documentation makes the limitation explicit, but it does not make existing fakeroot/LD_PRELOAD workflows work with the linux_raw backend. We should keep this open until we either have a supported compatibility path or decide that using the libc backend for
idis the long-term resolution.docs: document id rustix LD_PRELOAD compatibility