Public bug reported:

When built without `--features feat_external_stdbuf`, uutils `stdbuf`
creates a temporary directory with insecure permissions, and writes a
world-readable and world-writable libstdbuf.so file inside of it before
preloading it, allowing another user to execute arbitrary code if the
user executing `stdbuf` has a permissive umask [1].

Thankfully, Ubuntu uses this configuration. However, due to the sloppy
implementation, the temporary directories are still created and never
removed. This leads to `$TMPDIR` running out of inodes eventually:

```
ls --color=none -1a /tmp | LC_ALL=C grep '^\.tmp' | wc -l
0
$ while true; do parallel -n 1 -j 32 -N0 stdbuf -oL true ::: {1..100000}; done
[...]
Error in tempfile() using template /tmp/parXXXXX.arg: Could not create temp 
file /tmp/par8iEu6.arg: No space left on device at /usr/bin/parallel line 6309.
$ df --human-readable -i /tmp
Filesystem     Inodes IUsed IFree IUse% Mounted on
tmpfs            1.0M  1.0M     0  100% /tmp
$ ls --color=none -1a /tmp | LC_ALL=C grep '^\.tmp' | wc -l
1048519
```

I will note that as a co-maintainer of GNU coreutils, I find it
incredibly frustrating to see Canonical make it a chore to switch to GNU
coreutils when uutils has sloppy behavior like this [2].

[1] https://github.com/uutils/coreutils/issues/13939#issuecomment-5303138075
[2] 
https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2604BuildEssentialAndUutils

** Affects: rust-coreutils (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2163576

Title:
  uutils stdbuf places empty directories in `$TMPDIR`

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2163576/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to