Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 679124 - net-fs/nfs-utils-2.3.1-r3 with =sys-libs/musl-1.1.21 - rpc.mountd segmentation fault when NFS clients try to mount network share
Summary: net-fs/nfs-utils-2.3.1-r3 with =sys-libs/musl-1.1.21 - rpc.mountd segmentati...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-01 07:49 UTC by Alexander Miroshnichenko
Modified: 2019-09-02 06:10 UTC (History)
2 users (show)

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


Attachments
freeaddrinfo patch (Do-not-pass-null-pointer-to-freeaddrinfo.diff,1.04 KB, patch)
2019-03-06 13:33 UTC, Alexander Miroshnichenko
Details | Diff
Modified upstream patch to apply on 2.3.1-r3 (nfs-utils.git-ed06fade6dc46df0a38caab2e465dfaabfc76f46.patch,15.32 KB, patch)
2019-04-07 11:37 UTC, Stijn Tintel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Miroshnichenko 2019-03-01 07:49:41 UTC
After update sys-libs/musl from version 1.1.20-r1 to 1.1.21 the daemon rpc.mountd (net-fs/nfs-utils-2.3.1-r3) crashes with segfault when nfs clients try to mount network share.

[65473.056032] rpc.mountd[19759]: segfault at 28 ip 00006c865ac451a4 sp 00007d42d22eadb0 error 4 in libc.so[6c865ac06000+a2000]

NFS server stops work.

Right now I have downgraded package sys-libs/musl-1.1.20-r1 which works fine with rpc.mountd
Comment 1 Alexander Miroshnichenko 2019-03-01 07:50:40 UTC
# emerge --info
Portage 2.3.51 (python 3.6.5-final-0, default/linux/amd64/17.0/musl/hardened/selinux, gcc-8.2.0, musl-1.1.20-r1, 4.19.25.a-hardened-fitlet x86_64)
=================================================================
System uname: Linux-4.19.25.a-hardened-fitlet-x86_64-AMD_A10_Micro-6700T_APU+AMD_Radeon_R6_Graphics-with-gentoo-2.6
KiB Mem:     8096936 total,    153704 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 28 Feb 2019 21:00:01 +0000
Head commit of repository gentoo: 9f709b636e948552d72c4a94cd632bfa30f97e3a
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.30 p5) 2.30.0
ccache version 3.3.4 [disabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::musl
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            7.3.0-r3::musl, 8.2.0-r6::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/musl:            1.1.20-r1::gentoo
Repositories:

gentoo
    location: /usr/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

x-portage
    location: /usr/local/portage
    masters: gentoo

libressl
    location: /var/lib/layman/libressl
    masters: gentoo
    priority: 50

musl
    location: /var/lib/layman/musl
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-gentoo-linux-musl"
CFLAGS="-O2 -pipe -mssse3 -march=native"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.2/ext-active/ /etc/php/cgi-php7.2/ext-active/ /etc/php/cli-php7.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mssse3 -march=native"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=2 "
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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-logs candy cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
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="acl amd64 argon2 bcrypt bindist bzip2 caps cgroups crypt cxx dkim efi filecaps gnupg hardened https iconv iproute2 ipv6 leaps_timezone libressl libtirpc lucene lz4 lzma lzo managesieve mmx ncurses netlink nettle nfsv4 nfsv41 nls nptl openmp pam pcre pie postgres readline seccomp selinux sieve sse sse2 ssl ssp threads udev unicode xattr xfs xtpax zlib" ABI_X86="64" 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 f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="libressl" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 multiboot pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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, LANG, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Anthony Basile gentoo-dev 2019-03-01 11:19:30 UTC
Thanks for the report.  Can you produce a backtrace to show where the crash occurs.
Comment 3 Alexander Miroshnichenko 2019-03-05 13:35:33 UTC
This is incompleate backtrace because I can not compile (to enable debug symbols) net-fs/nfs-utils anymore.

Program received signal SIGSEGV, Segmentation fault.
0x000065e503069ca4 in freeaddrinfo (p=0x0) at src/network/freeaddrinfo.c:10
10      src/network/freeaddrinfo.c: No such file or directory.
(gdb) bt
#0  0x000065e503069ca4 in freeaddrinfo (p=0x0) at src/network/freeaddrinfo.c:10
#1  0x00000803d661f925 in ?? ()
#2  0x00000803d66200d1 in ?? ()
#3  0x00000803d6620518 in ?? ()
#4  0x00000803d661bc40 in ?? ()
#5  0x000065e50304706b in libc_start_main_stage2 (main=0x803d661b340, argc=1, argv=0x72137b553768) at src/env/__libc_start_main.c:94
#6  0x00000803d661bd88 in ?? ()
#7  0x0000000000000000 in ?? ()
(gdb) quit
Comment 4 Alexander Miroshnichenko 2019-03-05 14:11:56 UTC
May the patch https://patchwork.kernel.org/patch/10707759/ be related to the issue?
Comment 5 Alexander Miroshnichenko 2019-03-06 12:43:02 UTC
I can recompile nfs-utils with linux-headers from musl overlay
Compleate BT:

Program received signal SIGSEGV, Segmentation fault.
0x00006e032123fca4 in freeaddrinfo (p=p@entry=0x0) at src/network/freeaddrinfo.c:10
10      src/network/freeaddrinfo.c: No such file or directory.
(gdb) bt
#0  0x00006e032123fca4 in freeaddrinfo (p=p@entry=0x0) at src/network/freeaddrinfo.c:10
#1  0x000000e8d12217cf in nfsd_fh (f=5) at cache.c:837
#2  0x000000e8d1221ecc in cache_process_req (readfds=readfds@entry=0x74aae2973c80) at cache.c:1425
#3  0x000000e8d1222320 in my_svc_run () at svc_run.c:117
#4  0x000000e8d121dadf in main (argc=<optimized out>, argv=<optimized out>) at mountd.c:892
(gdb) quit
Comment 6 Alexander Miroshnichenko 2019-03-06 12:50:55 UTC
(In reply to Alexander Miroshnichenko from comment #4)
> May the patch https://patchwork.kernel.org/patch/10707759/ be related to the
> issue?

I tried to run with the patch applied. No success. Still same segfault.
Comment 7 Alexander Miroshnichenko 2019-03-06 13:33:32 UTC
Created attachment 567906 [details, diff]
freeaddrinfo patch
Comment 8 Alexander Miroshnichenko 2019-03-06 13:33:59 UTC
(In reply to Alexander Miroshnichenko from comment #7)
> Created attachment 567906 [details, diff] [details, diff]
> freeaddrinfo patch

This patch works for me.
Comment 9 Alexander Miroshnichenko 2019-03-06 13:52:50 UTC
I found the bug fixed in upstream

commit ed06fade6dc46df0a38caab2e465dfaabfc76f46
Author: Peter Wagner <tripolar@gmx.at>
Date:   Wed Feb 20 10:59:50 2019 -0500

    nfs-utils: fix addrinfo usage with musl-1.1.21
Comment 10 Stijn Tintel 2019-04-07 11:36:35 UTC
(In reply to Alexander Miroshnichenko from comment #9)
> I found the bug fixed in upstream
> 
> commit ed06fade6dc46df0a38caab2e465dfaabfc76f46
> Author: Peter Wagner <tripolar@gmx.at>
> Date:   Wed Feb 20 10:59:50 2019 -0500
> 
>     nfs-utils: fix addrinfo usage with musl-1.1.21

After modifying the patch so that it applies (small change in support/export/hostname.c), I can confirm it fixes the problem for me.
Comment 11 Stijn Tintel 2019-04-07 11:37:20 UTC
Created attachment 572166 [details, diff]
Modified upstream patch to apply on 2.3.1-r3
Comment 12 Matt Turner gentoo-dev 2019-09-02 06:10:01 UTC
Fixed in 2.3.4