Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 850691 - sys-libs/glibc-2.35-r7: fails last-minute sanity check on HPPA (segfaults)
Summary: sys-libs/glibc-2.35-r7: fails last-minute sanity check on HPPA (segfaults)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: HPPA Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard: >=2.35-r8, as is <2.35-r7
Keywords: PMASKED
Depends on:
Blocks: glibc-2.35-stable
  Show dependency tree
 
Reported: 2022-06-09 04:54 UTC by Sam James
Modified: 2022-07-29 01:41 UTC (History)
1 user (show)

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


Attachments
build.log.xz (build.log.xz,213.70 KB, application/x-xz)
2022-06-09 04:54 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-09 04:54:27 UTC
* Defaulting /etc/host.conf:multi to on
 * Last-minute run tests with ./ld.so.1 in /lib ...
/var/tmp/portage/sys-libs/glibc-2.35-r7/temp/environment: line 2322: 25492 Segmentation fault      (core dumped) LC_ALL=C ${newldso} --library-path . ${x} > /dev/null
 * ERROR: sys-libs/glibc-2.35-r7::gentoo failed (preinst phase):
 *   simple run test (/usr/bin/cal) failed
 *
 * Call stack:
 *     ebuild.sh, line  127:  Called pkg_preinst

----
# emerge --info
Portage 3.0.30 (python 3.9.13-final-0, default/linux/hppa/17.0, gcc-11.3.0, glibc-2.35-r4, 5.18.1 parisc)
=================================================================
System uname: Linux-5.18.1-parisc-PA8900_-Shortfin-with-glibc2.35
KiB Mem:     8206160 total,     35364 free
KiB Swap:    4194300 total,   4193780 free
Timestamp of repository gentoo: Thu, 09 Jun 2022 03:32:58 +0000
sh dash 0.5.11.5
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-lang/perl:             5.36.0::gentoo
dev-lang/python:           3.9.13::gentoo, 3.10.5::gentoo, 3.11.0_beta3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.18-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r4::gentoo
Repositories:

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

ACCEPT_KEYWORDS="hppa ~hppa"
ACCEPT_LICENSE="*"
CBUILD="hppa2.0-unknown-linux-gnu"
CFLAGS="-O2 -pipe -march=2.0 -fdiagnostics-show-option -frecord-gcc-switches"
CHOST="hppa2.0-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=2.0"
DISTDIR="/bound/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --complete-graph --with-bdeps=y --usepkg=y"
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 -march=2.0"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=2.0"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j5 -l5"
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"
SHELL="/bin/bash"
USE="acl big-endian bzip2 cli crypt fortran gdbm hppa iconv ipv6 libglvnd ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl unicode xattr zlib" ADA_TARGET="gnat_2020" 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" 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev dummy v4l" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-09 04:54:57 UTC
Created attachment 783686 [details]
build.log.xz
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-09 04:55:58 UTC
I can reproduce if I run the final command manually (LC_ALL=C gdb --args ./ld.so.1 --library-path . /usr/bin/cal, in /var/tmp/portage/sys-libs/glibc-2.35-r7/image/lib) using the just-built glibc.

```
Program received signal SIGSEGV, Segmentation fault.
0xf8f0405c in ?? () from ./libc.so.6
(gdb) bt
#0  0xf8f0405c in ?? () from ./libc.so.6
#1  0xf8f044cc in ?? () from ./libc.so.6
#2  0xf8f04588 in getopt_long () from ./libc.so.6
#3  0xf9690084 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
```

Not very helpful.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 00:04:27 UTC
Bisected to:
```
f5f7144dfcbf2a11fd2c17316c213928307c1db3 is the first bad commit
commit f5f7144dfcbf2a11fd2c17316c213928307c1db3
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Fri Jun 15 16:14:58 2018 +0100

    rtld: Use generic argv adjustment in ld.so [BZ #23293]

    When an executable is invoked as

      ./ld.so [ld.so-args] ./exe [exe-args]

    then the argv is adujusted in ld.so before calling the entry point of
    the executable so ld.so args are not visible to it.  On most targets
    this requires moving argv, env and auxv on the stack to ensure correct
    stack alignment at the entry point.  This had several issues:

    - The code for this adjustment on the stack is written in asm as part
      of the target specific ld.so _start code which is hard to maintain.

    - The adjustment is done after _dl_start returns, where it's too late
      to update GLRO(dl_auxv), as it is already readonly, so it points to
      memory that was clobbered by the adjustment. This is bug 23293.

    - _environ is also wrong in ld.so after the adjustment, but it is
      likely not used after _dl_start returns so this is not user visible.

    - _dl_argv was updated, but for this it was moved out of relro, which
      changes security properties across targets unnecessarily.

    This patch introduces a generic _dl_start_args_adjust function that
    handles the argument adjustments after ld.so processed its own args
    and before relro protection is applied.

    The same algorithm is used on all targets, _dl_skip_args is now 0, so
    existing target specific adjustment code is no longer used.  The bug
    affects aarch64, alpha, arc, arm, csky, ia64, nios2, s390-32 and sparc,
    other targets don't need the change in principle, only for consistency.

    The GNU Hurd start code relied on _dl_skip_args after dl_main returned,
    now it checks directly if args were adjusted and fixes the Hurd startup
    data accordingly.

    Follow up patches can remove _dl_skip_args and DL_ARGV_NOT_RELRO.

    Tested on aarch64-linux-gnu and cross tested on i686-gnu.

    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
    (cherry picked from commit ad43cac44a6860eaefcadadfb2acb349921e96bf)

 elf/rtld.c                    | 73 +++++++++++++++++++++++++++++++++++--------
 sysdeps/mach/hurd/dl-sysdep.c | 30 ++++++++----------
 2 files changed, 73 insertions(+), 30 deletions(-)
```

Ignore the date, it was committed only a few weeks ago, but it's an old patch.
Comment 4 Larry the Git Cow gentoo-dev 2022-06-10 01:00:18 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54e71bde6feb1bfd93d6fe169ff987adae0ab299

commit 54e71bde6feb1bfd93d6fe169ff987adae0ab299
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-06-10 00:59:57 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-10 00:59:57 +0000

    profiles/arch/hppa: mask crashing =sys-libs/glibc-2.35-r7
    
    Bug: https://bugs.gentoo.org/850691
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/hppa/package.mask | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-28 23:06:10 UTC
-r8 is fine.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-29 01:40:39 UTC
(In reply to Sam James from comment #5)
> -r8 is fine.

Bad versions are no longer in tree.