[Toybox] Android sitrep

Denys Nykula nykula at ukr.net
Thu Oct 17 14:09:21 PDT 2019


> the tar "no ../ files outside this directory" check is
> false positiving on "./" for some reason, gotta track that down.

Here's a reproducible toy tar crash, might or might not be connected.

git clone https://github.com/landley/toybox
wget http://musl.cc/x86_64-linux-musl-native.tgz
rm -r root.tar toybox/root x86_64-linux-musl-native
(cd toybox; make defconfig root)
toybox/toybox tar xf x86_64-linux-musl-native.tgz
(cd toybox/root/*/*fs; ../../../toybox tar c *)>root.tar
cd x86_64-linux-musl-native &&../toybox/toybox tar xvf ../root.tar
# ...
# tar: can't remove: bin: Is a directory
# tar: can't remove: lib: Is a directory
# tar: 'usr/' not under '/path/to/x86_64-linux-musl-native'
# Segmentation fault

First two errors are correct, refusing to overwrite an existing dir with
a symlink and moving on, remembering to make a bad exit code later. But
then you hit an existing symlink to a dir. Other implementations replace
the symlink with the dir and keep unpacking files there. Toy tar doesn't
overwrite, says odd message, starts extracting children of a dir that
hasn't been created, and crashes. Full output below.

bin
tar: can't remove: bin: Is a directory
dev/
etc/
etc/passwd
etc/group
etc/resolv.conf
home/
init
lib
tar: can't remove: lib: Is a directory
mnt/
proc/
root/
sbin
sys/
tmp/
usr/
tar: 'usr/' not under '/path/to/x86_64-linux-musl-native'
usr/lib/
usr/sbin/
Segmentation fault



More information about the Toybox mailing list