Backtrace from splitdebug version of dhclient used with NetworkManager: Core was generated by `/sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /run/dhclient-enp0s31f'. Program terminated with signal SIGABRT, Aborted. #0 0x00007fe6cc4454cb in raise () from /lib64/libc.so.6 (gdb) bt #0 0x00007fe6cc4454cb in raise () from /lib64/libc.so.6 #1 0x00007fe6cc446a61 in abort () from /lib64/libc.so.6 #2 0x00007fe6cc482f98 in ?? () from /lib64/libc.so.6 #3 0x00007fe6cc50f9df in __fortify_fail () from /lib64/libc.so.6 #4 0x00007fe6cc50d9e0 in __chk_fail () from /lib64/libc.so.6 #5 0x00007fe6cc50cc41 in __strcpy_chk () from /lib64/libc.so.6 #6 0x00000000004250ef in strcpy (__src=0x7ffc5cac1420 "docker_gwbridgeZ\002", __dest=0xa27ff4 "") at /usr/include/bits/string3.h:110 #7 discover_interfaces (state=state@entry=2) at discover.c:987 #8 0x0000000000407cd8 in main (argc=<optimized out>, argv=<optimized out>) at dhclient.c:628 The interface visible as __src is "docker_gwbridge" and the string was corrupted in some way. strlen("docker_gwbridge") == 15, while sizeof(tmp->name), which is the destination, == 16. I haven't had time to dig deeper yet. Mandatory emerge --info follows $ emerge --info Portage 2.3.0 (python 2.7.11-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r2, 4.6.4-gentoo x86_64) ================================================================= System uname: Linux-4.6.4-gentoo-x86_64-Intel-R-_Core-TM-_i7-6600U_CPU_@_2.60GHz-with-gentoo-2.2 KiB Mem: 16333944 total, 9209644 free KiB Swap: 33554428 total, 33554428 free Timestamp of repository gentoo: Sat, 16 Jul 2016 11:30:01 +0000 sh bash 4.3_p46 ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1 app-shells/bash: 4.3_p46::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.0-r1::gentoo dev-lang/python: 2.7.11-r2::gentoo, 3.4.4::gentoo dev-util/cmake: 3.6.0::gentoo dev-util/pkgconfig: 0.29.1::gentoo sys-apps/baselayout: 2.2-r1::gentoo sys-apps/sandbox: 2.10-r2::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r2::gentoo sys-devel/automake: 1.12.6-r1::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.26.1::gentoo sys-devel/gcc: 5.4.0::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r2::gentoo sys-devel/make: 4.2.1::gentoo sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers) sys-libs/glibc: 2.23-r2::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 local-crossdev location: /usr/local/portage-crossdev masters: gentoo priority: 10 mlen location: /var/lib/layman/mlen masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -fno-omit-frame-pointer -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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -fno-omit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5 -l5" 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="X aac aacplus acl alsa amd64 audit berkdb bzip2 caps cgroups cli cracklib crypt cryptsetup cups cxx dbus dri faac flac fortran gdbm geoclue geoloc geolocation gif gnome-keyring gtk gtk3 gtkstyle hidpi hotwording iconv idn infinality introspection iproute2 ipv6 jpeg libedit libnotify llvm lvm mbim mmx mmxext modemmanager modules mp3 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp opus oss pam pch pcre png policykit pulseaudio python qt5 readline samba seccomp session sound sse sse2 ssl startup-notification systemd tcpd theora tiff truetype udev udisks unicode unwind vdpau vim-syntax virt-network vorbis webp widgets x264 xattr xft xinerama zlib zsh-completion" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="synaptics evdev" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="x86_64 i386 arm" QEMU_USER_TARGETS="x86_64 i386 arm" RUBY_TARGETS="ruby23 ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Full commandline: /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /run/dhclient-enp0s31f6.pid -lf /var/lib/NetworkManager/dhclient-dbe9f4f3-b9e6-3137-baa2-e7eed032df41-enp0s31f6.lease -cf /var/lib/NetworkManager/dhclient-enp0s31f6.conf enp0s31f6
Looks like strncpy in discover.c:558 is the culprit. The size of the buffer passed to the function is not correct and buffer should be explicitly null terminated (strncpy doesn't do this if it fills the whole buffer). I'll add a patch soon.
s/558/550/
Created attachment 440980 [details, diff] patch for incorrect use of strncpy
Created attachment 440982 [details] updated ebuild
Added patch builds cleanly, the check for interface name length above strncpy looks correct to me and didn't require updates after patching.
patch looks correct to me since you found+fixed the issue, feel like submitting it here: https://www.isc.org/community/report-bug/
Reported, bug id: [ISC-Bugs #42891]
Reply I received: > Thank you for your bug report > > We believe we have already fixed this in a different > bug ticket. This patch will be in 4.3.5 and 4.1-ESV-R14 > when they ship later this year. > > If the problem persists after you switch to > a newer version please either re-open the ticket > or open a new ticket. In this case I'd suggest to patch it in portage until 4.3.5 gets released.
This was fixed in dhcp-4.3.5