Package: eatmydata
Version: 105-7
Severity: wishlist

I’ve just read something in the glibc ld.so manpage (because I am
considering writing a preloadable library myself) and now wonder:

tglase@tglase:~ $ LD_PRELOAD=libeatmydata.so sudo date -u
ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded 
(cannot open shared object file): ignored.
Thu Feb 14 21:21:32 UTC 2019
tglase@tglase:~ $ sudo chmod u+s /usr/lib/*/libeatmydata.so
tglase@tglase:~ $ LD_PRELOAD=libeatmydata.so sudo date -u
Thu Feb 14 21:21:48 UTC 2019

Is there a reason we’re not setting the suid bit on the .so ?

       LD_PRELOAD
[…]
              In secure-execution mode, preload pathnames  containing  slashes
              are  ignored.   Furthermore,  shared  objects are preloaded only
              from the standard search directories and only if they have  set-
              user-ID mode bit enabled (which is not typical).

Since the move of the .so to /usr/lib/$MULTIARCH/ we don’t need
LD_LIBRARY_PATH (ignored in “secure-execution mode”) any more,
so there’s no reason we shouldn’t be able to do this, and it
avoids a *very* annoying error message.

file://localhost/usr/share/doc/debian-policy/policy.html/ch-files.html#permissions-and-owners
(Policy §10.9) says we could install with 4755. Although, after
the above commands we have 4644, weird, but perhaps immediately
signalling that this is only for ld.so and that the DLL itself
is not executable.

tglase@tglase:~ $ ll $(readlink -f /usr/lib/*/libeatmydata.so)
-rwSr--r-- 1 root root 13564 Okt 29 12:08 
/usr/lib/i386-linux-gnu/libeatmydata.so.1.1.2
-rwSr--r-- 1 root root 13568 Okt 29 12:08 
/usr/lib/x86_64-linux-gnux32/libeatmydata.so.1.1.2

And if a local admin disagrees, we have §10.9.1 dpkg-statoverride(1).
Granted, people could argue we should use that to enable the suid bit
in the first place, but I doubt that is the first thing on peoples’
mind when they encounter that irritating warning (plus by then it’s
already too late, and the apt/dpkg run you wanted to do takes 2 hours
instead of 5 minutes, and if you interrupt it, things break, too).
Furthermore, this is highly glibc ld.so-specific, so people from other
Unicēs wouldn’t even know this either.

I’m looking for two things here:

• precedent, so I’ll eventually be able to package up my own preload
  library (an X11 IME, in case someone wonders) and use it like that
• making the life of eatmydata users easier by enabling it by default

-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386, amd64

Kernel: Linux 4.18.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)

Versions of packages eatmydata depends on:
ii  libeatmydata1  105-7

eatmydata recommends no packages.

eatmydata suggests no packages.

-- no debconf information

Reply via email to