After upgrading to nftables-0.6-r1, running nft segfauilts. Reverting to nftables-0.5-r4 and it works again. Portage 2.3.0 (python 3.5.1-final-0, hardened/linux/amd64, gcc-5.4.0, glibc-2.23-r2, 4.5.7-hardened-r7 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-4.5.7-hardened-r7-x86_64-Intel-R-_Core-TM-_i5-2320_CPU_@_3.00GHz-with-gentoo-2.2 KiB Mem: 8155528 total, 2339680 free KiB Swap: 16777212 total, 16540544 free Timestamp of repository gentoo: Wed, 06 Jul 2016 16:15:01 +0000 Timestamp of repository fidonet: Fri, 11 Mar 2016 04:20:32 +0000 sh bash 4.3_p46 ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.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, 3.5.1-r3::gentoo dev-util/cmake: 3.5.2-r1::gentoo dev-util/pkgconfig: 0.29.1::gentoo sys-apps/baselayout: 2.2-r1::gentoo sys-apps/openrc: 0.21.1::gentoo sys-apps/sandbox: 2.10-r2::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r2::gentoo sys-devel/automake: 1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.25.1-r1::gentoo sys-devel/gcc: 4.9.3::gentoo, 5.3.0::gentoo, 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.uk.gentoo.org/gentoo-portage priority: -1000 fidonet location: /var/lib/layman/fidonet masters: gentoo priority: 50 hasufell location: /var/lib/layman/hasufell masters: gentoo priority: 50 x11 location: /var/lib/layman/x11 sync-uri: https://anongit.gentoo.org/git/proj/x11.git masters: gentoo priority: 50 Graham location: /usr/local/portage masters: gentoo priority: 200 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -mtune=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind /var/spool/munin-async/.ssh" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/games/angband/gamedata/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /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="-march=native -mtune=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps y" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildpkg cgroup config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -mtune=native -O2 -pipe" GENTOO_MIRRORS="http://mirrors.linuxant.fr/distfiles.gentoo.org/ ftp://mirror.qubenet.net/mirror/gentoo/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://mirror.qubenet.net/mirror/gentoo/" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j5" 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 a52 aac acl alsa amd64 apache2 avx berkdb branding bzip2 cairo caps cdda cddb cli cracklib crypt cups cxx dbus directfb doc dri dts dvd eds emacs encode examples exif fam ffmpeg flac fontconfig fortran gd gdbm geoip gif gmp gnome gnome-keyring gnutls gpm gstreamer gtk hardened iconv icu imagemagick introspection ipv6 java jpeg jpeg2k justify kde lcms libnotify libsamplerate lm_sensors lua lzma mad matroska milter mmx mmxext mng modplug modules mp3 mp4 mpeg mtp multilib mysql ncurses nls nptl nsplugin offensive ogg opengl openmp pam pax_kernel pcre perl pfd pie png policykit postgres ppds pulseaudio python qt4 qt5 raw readline sdl seccomp semantic-desktop session sound speex spell sqlite sqlite3 sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssp ssse3 startup-notification svg systemd tcpd theora threads tiff tk truetype udev unicode urandom usb v4l vaapi vdpau vim-syntax vorbis wayland x264 xattr xcb xml xmp xtpax xv xvid zlib" ABI_X86="64 32" 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" APACHE2_MPMS="worker" CALLIGRA_FEATURES="braindump flow karbon kexi krita sheets words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx 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="keyboard mouse evdev" KERNEL="linux" L10N="en-GB en fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en fr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_5" RUBY_TARGETS="ruby20 ruby21 ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="nouveau" 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" USE_PYTHON="2.7 3.3" Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= net-firewall/nftables-0.5-r4::gentoo was built with the following: USE="doc gmp readline -debug" ABI_X86="64"
Could you please attach a backtrace of the segfault?
Could you also provide the firewall configuration you were trying to use and on which part of that configuration the segfault occurred?
I do not have a core dump, as it was not built with debugging compiler flags. The initial segfault was when I ran 'nft -a list table inet filter' immediately after upgrading the package - while the configuration from 0.5-r4 was loaded in the kernel. It then segfaulted on system boot. Since then I have upgraded the kernel to 4.6.3-r2 and have manually entered my configuration line by line. The command causing the segfault is:- nft add rule inet filter input ip protocol igmp accept All other lines loaded OK.
(In reply to Graham Murray from comment #3) > Since then I have upgraded the kernel to 4.6.3-r2 to clarify, that is hardened-sources-4.6.3-r2
Reproduced using gentoo-sources-4.6.3. Posting the gdb output for anyone interested. I'll file a bug upstream to Starting program: /sbin/nft add rule ip filter input ip protocol igmp counter accept Program received signal SIGSEGV, Segmentation fault. 0x0000000000417136 in payload_expr_pctx_update (ctx=0x7fffffffe748, expr=0x6767f0) at payload.c:88 88 assert(desc->base <= PROTO_BASE_MAX); #0 0x0000000000417136 in payload_expr_pctx_update (ctx=0x7fffffffe748, expr=0x6767f0) at payload.c:88 #1 0x0000000000413453 in expr_evaluate_relational (ctx=0x7fffffffe708, expr=0x6768c8) at evaluate.c:1436 #2 0x0000000000413a26 in expr_evaluate (ctx=0x7fffffffe708, expr=0x6768c8) at evaluate.c:1584 #3 0x0000000000413a84 in stmt_evaluate_expr (ctx=0x7fffffffe708, stmt=0x676880) at evaluate.c:1593 #4 0x0000000000415289 in stmt_evaluate (ctx=0x7fffffffe708, stmt=0x676880) at evaluate.c:2290 #5 0x0000000000415b94 in rule_evaluate (ctx=0x7fffffffe708, rule=0x676a60) at evaluate.c:2470 #6 0x000000000041622b in cmd_evaluate_add (ctx=0x7fffffffe708, cmd=0x676b50) at evaluate.c:2614 #7 0x0000000000416a0b in cmd_evaluate (ctx=0x7fffffffe708, cmd=0x676b50) at evaluate.c:2857 #8 0x000000000043a3d6 in nft_parse (scanner=0x6764c0, state=0x7fffffffe120) at parser_bison.y:672 #9 0x0000000000405d15 in nft_run (scanner=0x6764c0, state=0x7fffffffe120, msgs=0x7fffffffe110) at main.c:231 #10 0x000000000040622a in main (argc=11, argv=0x7fffffffe928) at main.c:361
Filed a bug upstream for this issue. I believe the problem lies in commit 20b1131c07acd2fc71803be592430f0e06c4090e of upstream's repository (http://git.netfilter.org/nftables/), but reverting the entire commit failed. There is a single hunk for the payload_expr_pctx_update() function, but I haven't tried just reverting that one hunk yet.
fixed with commit 43c988c13be72ad3b4444b9fcd96b4377743ced9.