Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 768435 - app-misc/pax-utils[seccomp] Since updated to glibc-2.33 estrip (scanelf) does core dump (bad system call)
Summary: app-misc/pax-utils[seccomp] Since updated to glibc-2.33 estrip (scanelf) does...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Sergei Trofimovich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: glibc-2.33
  Show dependency tree
 
Reported: 2021-02-03 06:48 UTC by Cănărău Constantin
Modified: 2021-02-03 20:49 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cănărău Constantin 2021-02-03 06:48:42 UTC
Since updated system to sys-libs/glibc-2.33, in the final phase of compile estrip fail with:
/usr/lib/portage/python3.9/estrip: line 38: 758175 Bad system call         (core dumped) scanelf -yqRBF '#k%F' -k '.symtab' "${find_paths[@]}"
on every package

Reproducible: Always




Portage 3.0.14 (python 3.9.1-final-0, default/linux/amd64/17.1/no-multilib, gcc-10.2.0, glibc-2.33, 5.10.12-gentoo-costel x86_64)
=================================================================
System uname: Linux-5.10.12-gentoo-costel-x86_64-Intel-R-_Core-TM-_i7-6700K_CPU_@_4.00GHz-with-glibc2.33
KiB Mem:    32742288 total,  23894704 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 02 Feb 2021 16:45:01 +0000
Head commit of repository gentoo: 0c8471569ecae397bc8f893e9619aea6871df412
sh bash 5.1_p4
ld GNU ld (Gentoo 2.36 p1) 2.36.0
app-shells/bash:          5.1_p4::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.0-r1::gentoo
dev-lang/python:          2.7.18-r100::improve, 3.9.1-r1::improve
dev-util/cmake:           3.19.4::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.36::gentoo
sys-devel/gcc:            10.2.0-r5::improve
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.33::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.ro.gentoo.org/gentoo-portage/
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: --human-readable --delete-before --progress
    sync-rsync-verify-jobs: 4
    sync-rsync-vcs-ignore: true
    sync-rsync-verify-max-age: 24

added
    location: /var/db/repos/added
    masters: gentoo
    priority: 100

gnome
    location: /var/db/repos/gnome
    masters: gentoo
    priority: 100

improve
    location: /var/db/repos/improve
    masters: gentoo
    priority: 100

newer
    location: /var/db/repos/newer
    masters: gentoo
    priority: 100

python
    location: /var/db/repos/python
    masters: gentoo
    priority: 100

Installed sets: @desktop, @dev, @minimal, @vpn, @xfce
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=native -w -falign-functions=32 -fgraphite-identity -floop-nest-optimize -funsafe-math-optimizations -fipa-pta -fno-semantic-interposition -fno-plt -flto=auto -flto-compression-level=9 -fdevirtualize-at-ltrans"
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/php/apache2-php8.0/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -march=native -w -falign-functions=32 -fgraphite-identity -floop-nest-optimize -funsafe-math-optimizations -fipa-pta -fno-semantic-interposition -fno-plt -flto=auto -flto-compression-level=9 -fdevirtualize-at-ltrans"
DISTDIR="/mnt/linux/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=3 --load-average=9 --keep-going --with-bdeps=y --complete-graph --quiet-build=n --autounmask-write"
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 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy cgroup collision-protect config-protect-if-modified distlocks fail-clean fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nodoc noinfo parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-filter unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirrors.xservers.ro/gentoo/ http://distfiles.gentoo.org/"
INSTALL_MASK="/usr/share/locale -/usr/share/locale/ro -/usr/share/locale/en -/usr/share/locale/en_US"
LANG="ro_RO.UTF-8"
LC_ALL="ro_RO.UTF-8"
LDFLAGS="-Wl,-O1,--sort-common,--hash-style=gnu,--enable-new-dtags,--as-needed,-z,relro,-z,now -flto=auto"
MAKEOPTS="-j8 --load-average=10"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--human-readable --delete-before --progress"
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="X aac acl acpi aes alsa amd64 avx avx2 berkdb branding bzip2 cairo caps cli crypt dbus dri encode f16c fam flac fma3 fortran gdbm gif gpm gtk gtk3 iconv icu ipv6 jpeg jpeg2k libglvnd libtirpc lm-sensors lz4 mmx mmxext mp3 mpeg ncurses networkmanager nls nptl ogg opengl openmp opus pam pango pclmul pcre pdf png policykit popcnt portaudio pulseaudio readline seccomp server split-usr sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 svg systemd tcpd theora threads tiff truetype udev udisks unicode usb vaapi vdpau vhosts vorbis vulkan webp x264 xattr zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel usb-audio" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="ro en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF NVPTX X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset fastcgi geoip2 gunzip gzip limit_conn limit_req memcached naxsi realip referer rewrite split_clients ssi userid" NGINX_MODULES_STREAM="access geoip2 limit_conn realip" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-0" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

I observed this during a full rebuild (emerge -e world). I am not sure that it is related to glibc, so I won't mark dependencies.

Thank you!
Comment 1 Ionen Wolkens gentoo-dev 2021-02-03 08:30:49 UTC
$ strace -f  scanelf -T /usr/bin/
execve("/usr/bin/scanelf", ["scanelf", "-T", "/usr/bin/"], 0x7ffff75c4010 /* 44 vars */) = 0
...
faccessat2(AT_FDCWD, "/usr/bin/", F_OK, AT_EACCESS) = ?
+++ killed by SIGSYS +++
Bad system call
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-02-03 19:37:37 UTC
Yeah, noticed it locally too. We'll need to add faccessat2 to list of allowed syscalls.


Somehow scanelf just works for me and fails only when ran under emerge. I wonder why.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2021-02-03 19:38:35 UTC
(In reply to Sergei Trofimovich from comment #2)
> Yeah, noticed it locally too. We'll need to add faccessat2 to list of
> allowed syscalls.
> 
> 
> Somehow scanelf just works for me and fails only when ran under emerge. I
> wonder why.

Oh, it happens only under sandbox.
Comment 4 Larry the Git Cow gentoo-dev 2021-02-03 19:46:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=e2378b8c6bef5d94805444797e7fe35c07f54783

commit e2378b8c6bef5d94805444797e7fe35c07f54783
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2021-02-03 19:44:37 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-02-03 19:44:37 +0000

    security.c: allow faccessat2 syscall in seccomt filters
    
    Under glibc-2.33 sandox uses faccessat2 to stat symlinks.
    
    Reported-by: Cănărău Constantin
    Bug: https://bugs.gentoo.org/768435
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 security.c | 1 +
 1 file changed, 1 insertion(+)
Comment 5 Larry the Git Cow gentoo-dev 2021-02-03 20:17:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=e6bcbe9913d50e55c6208171778352eee6b6d399

commit e6bcbe9913d50e55c6208171778352eee6b6d399
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2021-02-03 20:11:49 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-02-03 20:16:43 +0000

    Revert "security.c: allow faccessat2 syscall in seccomt filters"
    
    libseccomp does not yet provide faccessat2. I tested the commit
    without seccomp enabled.
    
    This reverts commit e2378b8c6bef5d94805444797e7fe35c07f54783.
    
    Bug: https://bugs.gentoo.org/768435
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 security.c | 1 -
 1 file changed, 1 deletion(-)
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2021-02-03 20:39:57 UTC
Filed https://github.com/seccomp/libseccomp/issues/314 to add `faccessat2` to libseccomp syscall list.
Comment 7 Larry the Git Cow gentoo-dev 2021-02-03 20:41:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=3c57b08ca0d0e276c8ae93c9e0984ad60bd2ff69

commit 3c57b08ca0d0e276c8ae93c9e0984ad60bd2ff69
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2021-02-03 20:40:12 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-02-03 20:40:12 +0000

    security.c: allow faccessat2 syscall in seccomt filters (take 2)
    
    Under glibc-2.33 sandox uses faccessat2 to stat symlinks.
    
    Unfortunately libseccomp does not yet provide syscall definition
    for faccessat2. Define it locally.
    
    Reported-by: Cănărău Constantin
    Bug: https://bugs.gentoo.org/768435
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 security.c | 5 +++++
 1 file changed, 5 insertions(+)
Comment 8 Larry the Git Cow gentoo-dev 2021-02-03 20:49:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33243f9ffe2824c7847062a50417762cabec508c

commit 33243f9ffe2824c7847062a50417762cabec508c
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2021-02-03 20:46:23 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2021-02-03 20:49:15 +0000

    app-misc/pax-utils: bump up to 1.2.9
    
    Three new fixes:
    - security.c: allow faccessat2 syscall in seccomt filters
    - scanmacho: add support for dumping UUIDs
    - {,pax}macho: add support for arm64 arch
    
    Reported-by: Cănărău Constantin
    Closes: https://bugs.gentoo.org/768435
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 app-misc/pax-utils/Manifest               |  1 +
 app-misc/pax-utils/pax-utils-1.2.9.ebuild | 78 +++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)