Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 779940 - sys-apps/file-5.39-r4: invalid system call with USE="seccomp lzma"
Summary: sys-apps/file-5.39-r4: invalid system call with USE="seccomp lzma"
Status: RESOLVED DUPLICATE of bug 776988
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-04 05:11 UTC by Dmytro 'daks' Fomenko
Modified: 2021-04-04 06:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
strace of the file -z ./test.zip (strace.out.16480,17.42 KB, text/plain)
2021-04-04 05:17 UTC, Dmytro 'daks' Fomenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmytro 'daks' Fomenko 2021-04-04 05:11:53 UTC
Getting 'invalid system call' on invocation of '/usr/bin/file' against any zip'ped file with '-z' option.

daks@power 92 % ls -l .
total 0

daks@power 92 % echo "test" > ./test.txt

daks@power 92 % zip -r test ./test.txt
  adding: test.txt (stored 0%)

daks@power 92 % ls -l .
total 8.0K
-rw-r--r-- 1 daks daks   5 Apr  3 23:28 test.txt
-rw-r--r-- 1 daks daks 171 Apr  3 23:28 test.zip

daks@power 92 % file ./test.zip
./test.zip: Zip archive data, at least v1.0 to extract

daks@power 92 % file -z ./test.zip
./test.zip: [1]    15599 invalid system call  file -L -z ./test.zip

sys-app/file 5.39-r4 is installed with both 'seccomp' and 'zlib' flags:

daks@power 92 % eix -e file
[I] sys-apps/file
     Available versions:  5.39-r4 ~5.40 **9999*l {bzip2 lzma python seccomp static-libs zlib ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" PYTHON_TARGETS="python3_7 python3_8 python3_9"}
     Installed versions:  5.39-r4(22:30:52 04/03/21)(bzip2 lzma seccomp zlib -python -static-libs ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python3_8 -python3_7 -python3_9")
     Homepage:            https://www.darwinsys.com/file/
     Description:         identify a file's format by scanning binary data for patterns



Reproducible: Always

Steps to Reproduce:
1. Have sys-apps/file compiled with the default USE flags (ie 'seccomp' enabled)
2. Create a zip file (not empty!)
3. Run '/usr/bin/file -z' against it
4. See the 'invalid system call' error



daks@power ~ % emerge --info
Portage 3.0.17 (python 3.8.8-final-0, default/linux/amd64/17.1, gcc-10.2.0, glibc-2.32-r7, 5.11.10-gentoo-15 x86_64)
=================================================================
System uname: Linux-5.11.10-gentoo-15-x86_64-Intel-R-_Core-TM-_i7-9700KF_CPU_@_3.60GHz-with-glibc2.2.5
KiB Mem:    32827624 total,   2804068 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 04 Apr 2021 03:15:01 +0000
Head commit of repository gentoo: 33b9be6fa18cd5447f8e162fd5045736b3540cb2
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.8.8::gentoo, 3.9.2::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r5::gentoo
sys-devel/gcc-config:     2.3.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.us.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

local_overlay
    location: /var/db/repos/local/local_overlay
    masters: gentoo
    priority: 0

daks_local
    location: /var/db/repos/local/daks-overlay
    masters: gentoo
    priority: 1

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--ask-enter-invalid --keep-going --with-bdeps=y --complete-graph=y --quiet-build=y --jobs=1 --verbose-conflicts"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=native -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news nodoc parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -march=native -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="uk_UA.utf8"
LC_ALL="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en uk uk_UA"
MAKEOPTS="-j8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="256-color X aac aacplus acl acpi alsa amd64 apcupsd bash-completion berkdb btrfs bzip2 cli crypt cups dbus dri drm dvd elogind exif ffmpeg flac fortran gdbm gif gpm gstreamer iconv icu idn ipv6 jpeg libglvnd libnotify libtirpc lzma mp3 mp4 multilib ncurses nls nptl ogg opengl openmp pam pcre pdf png policykit pulseaudio readline spell spice split-usr ssl svg syslog tcpd tiff truetype udev unicode usb vdpau vim-syntax vorbis wavpack xattr xmp zlib zsh-completion zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en uk uk-UA" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="nlpsolver scripting-javascript wiki-publisher" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Dmytro 'daks' Fomenko 2021-04-04 05:17:25 UTC
Created attachment 697107 [details]
strace of the file -z ./test.zip

Result of the 'strace -f -v -e verbose=all -s 32768 -f -o ./strace.out file -z ./test.zip' command:
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-04 05:55:15 UTC
This is intentional by upstream although I agree it’s confusing. I’ve filed a bug upstream for better error handling (see linked bug).

This is a bug in whatever application tried to use -z with seccomp if there was one.

*** This bug has been marked as a duplicate of bug 771096 ***
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-04 05:56:17 UTC
Sorry, this one, on mobile.

*** This bug has been marked as a duplicate of bug 776988 ***
Comment 4 Dmytro 'daks' Fomenko 2021-04-04 06:09:57 UTC
Thanks, for the quick reply, Sam!
Correct me if I'm wrong: a package that brought up an issue (because of upstream decision) is stable (sys-apps/file-5.39-r4), but the fixed version of the package it breaks is not stable (app-misc/mc-4.8.26-r2, ~amd64)?