All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wilmer van der Gaast <wilmer@gaast.net>
To: netfilter-devel@vger.kernel.org
Subject: Bug report: Segfault on nested sets with prefixes
Date: Sun, 06 Sep 2015 20:48:32 +0100	[thread overview]
Message-ID: <55EC9890.1080205@gaast.net> (raw)

Hello,

The following ruleset causes a segfault:

#! /usr/sbin/nft -f

flush table inet filter
				
define test1 = {
	1.1.1.0/24,
}

define test2 = {
	$test1,
	2.2.2.0/24,
}
								
table inet filter {
	chain input {
		type filter hook input priority 0;
		ip saddr $test2 counter;
	}
}

Either removing the /24s to make them addresses instead of prefixes, or 
including test1 instead of test2, avoids the crash.

Backtrace from valgrind:

==21601== Process terminating with default action of signal 11 (SIGSEGV)
==21601==  Access not within mapped region at address 0x1D
==21601==    at 0x54C2EB0: __gmpz_cmp (in 
/usr/lib/x86_64-linux-gnu/libgmp.so.10.2.0)
==21601==    by 0x416CFA: ei_lookup.isra.0 (segtree.c:121)
==21601==    by 0x417040: ei_insert (segtree.c:189)
==21601==    by 0x417040: set_to_segtree (segtree.c:339)
==21601==    by 0x417040: set_to_intervals (segtree.c:440)
==21601==    by 0x406652: do_add_set (rule.c:659)
==21601==    by 0x406978: do_add_table (rule.c:679)
==21601==    by 0x406978: do_command_add (rule.c:695)
==21601==    by 0x407AEB: do_command (rule.c:1024)
==21601==    by 0x4060A5: nft_netlink (main.c:194)
==21601==    by 0x4060A5: nft_run (main.c:235)
==21601==    by 0x405C17: main (main.c:360)

Is this the right place to report issues like this?


Kind regards,

Wilmer van der Gaast.

-- 
+-------- .''`.     - -- ---+  +        - -- --- ---- ----- ------+
| wilmer : :'  :  gaast.net |  | OSS Programmer   www.bitlbee.org |
| lintux `. `~'  debian.org |  | Full-time geek  wilmer.gaast.net |
+--- -- -  ` ---------------+  +------ ----- ---- --- -- -        +

             reply	other threads:[~2015-09-06 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-06 19:48 Wilmer van der Gaast [this message]
2015-09-07 18:49 ` Bug report: Segfault on nested sets with prefixes Pablo Neira Ayuso
2015-09-09 10:02   ` Wilmer van der Gaast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55EC9890.1080205@gaast.net \
    --to=wilmer@gaast.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.