Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873700 - net-dns/dnsmasq-2.86-r1 segfault when carrier is lost
Summary: net-dns/dnsmasq-2.86-r1 segfault when carrier is lost
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords: PATCH
: 890485 (view as bug list)
Depends on: 890575
Blocks:
  Show dependency tree
 
Reported: 2022-09-30 20:45 UTC by Tango
Modified: 2023-01-12 07:12 UTC (History)
2 users (show)

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


Attachments
Proposed Patch (empty-resolve.patch,1.21 KB, patch)
2022-09-30 20:45 UTC, Tango
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tango 2022-09-30 20:45:45 UTC
Created attachment 814876 [details, diff]
Proposed Patch

When my modem looses connection to my ISP, dnsmasq segfaults:

I can reproduce the segfault by forcing a shutdown

610491.966721] igb 0000:18:00.0 enp24s0: igb: enp24s0 NIC Link is Down <-----FORCE SHUTDOWN & WAIT
dnsmasq[4466]: segfault at 564ee6851602 ip 0000564ee65f2ad8 sp 00007ffcd7a6f170 error 4 in dnsmasq[564ee65b5000+3f000]
[610517.441236] Code: ff ff 48 83 7c 24 08 00 48 8b 44 24 08 7f 1b e9 d3 fe ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 49 ff c7 48 ff c8 74 07 <41> 80 7f ff 2e 75 f1 48 89 44 24 08 e9 b7 fd ff ff 0f 1f 80 00 00
[611396.879260] igb 0000:18:00.0 enp24s0: igb: enp24s0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX <-----BRING IT BACK ONLINE

SuperTux ~ $ ping -c4 www.gentoo.org <---- FROM THE LAN
ping: www.gentoo.org: Temporary failure in name resolution

SuperTux ~ $ ping -c4 146.75.106.137
PING 146.75.106.137 (146.75.106.137) 56(84) bytes of data.
64 bytes from 146.75.106.137: icmp_seq=1 ttl=52 time=26.0 ms
64 bytes from 146.75.106.137: icmp_seq=2 ttl=52 time=25.6 ms
64 bytes from 146.75.106.137: icmp_seq=3 ttl=52 time=29.0 ms
64 bytes from 146.75.106.137: icmp_seq=4 ttl=52 time=29.5 ms

--- 146.75.106.137 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 25.550/27.504/29.458/1.739 ms
michael@SuperTux ~ $

A restart of dnsmasq is required to restore LAN usability.

MasterTux /home/michael # /etc/init.d/dnsmasq restart <----- FROM SERVER VIA SSH
 * Stopping dnsmasq ...
 * start-stop-daemon: no matching processes found <----- FROM SEGFAULT OF DNSMASQ                                                                [ ok ]
 * Starting dnsmasq ...

I have chased this down to a bug introduced in dnsmasq-2.86, located and tested a patch which resolves my issues.
Comment 1 Tango 2022-09-30 20:47:02 UTC
Portage 3.0.36 (python 3.10.6-final-0, default/linux/amd64/17.1, gcc-11.3.0, glibc-2.35-r8, 4.19.86-gentoo x86_64)
=================================================================
System uname: Linux-4.19.86-gentoo-x86_64-AMD_Ryzen_7_2700X_Eight-Core_Processor-with-glibc2.35
KiB Mem:    32952992 total,  30651980 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 30 Sep 2022 08:00:01 +0000
Head commit of repository gentoo: 9ec06b4a7293120895291882615efd79ac64e6d3
sh bash 5.1_p16-r1
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.10.6_p4::gentoo
dev-lang/rust:             1.62.1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45.2::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/llvm:            14.0.6-r2::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    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-verify-max-age: 24
    sync-rsync-extra-opts: 

Installed sets: @mate-extras
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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="-march=znver2 -O2 -pipe"
DISTDIR="/var/cache/distfiles"
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="-march=znver2 -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch 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="-march=znver2 -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j17"
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="X acl amd64 bzip2 caja cli crypt cups dbus dri elogind ffmpeg fortran gdbm gtk iconv ipv6 libglvnd libnotify libtirpc mate multilib ncurses nls nptl openal opengl openmp pam pcre policykit pulseaudio python readline seccomp split-usr sqlite ssl unicode usb xattr zlib" ABI_X86="64 32" 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" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a 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" 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_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, 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 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-30 20:47:11 UTC
Thanks. Could you send the patch upstream - or is it fixed in 2.87 (not yet in tree)?
Comment 3 Tango 2022-09-30 20:57:50 UTC
(In reply to Sam James from comment #2)
> Thanks. Could you send the patch upstream - or is it fixed in 2.87 (not yet
> in tree)?

I got the patch from upstream so I assume it is fixed in 2.87, will wait until 2.87 is in portage to test for it.

https://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=patch;h=d290630d31f4517ab26392d00753d1397f9a4114
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-01-12 04:20:10 UTC
*** Bug 890485 has been marked as a duplicate of this bug. ***
Comment 5 Larry the Git Cow gentoo-dev 2023-01-12 04:22:06 UTC
The bug has been closed via the following commit(s):

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

commit c2f760ca8d672081ad179e7aae150c57a9615b37
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-01-12 04:21:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-01-12 04:21:21 +0000

    net-dns/dnsmasq: add 2.88
    
    Bug: https://bugs.gentoo.org/890485
    Closes: https://bugs.gentoo.org/873700
    Signed-off-by: Sam James <sam@gentoo.org>

 net-dns/dnsmasq/Manifest            |   1 +
 net-dns/dnsmasq/dnsmasq-2.88.ebuild | 224 ++++++++++++++++++++++++++++++++++++
 2 files changed, 225 insertions(+)