From: Oleksandr Natalenko <oleksandr@natalenko.name>
To: netfilter-devel@vger.kernel.org
Subject: Re: nft segfaults listing huge sets
Date: Mon, 02 Jan 2017 11:17:37 +0100 [thread overview]
Message-ID: <30e150bbf639585c825f03ce9080429a@natalenko.name> (raw)
In-Reply-To: <9051843e593289b7aa4d670dd304bbe5@natalenko.name>
nftables: 0.7
kernel: 4.8 and 4.9.
02.01.2017 11:12, Oleksandr Natalenko написав:
> /* Please CC me, I'm not subscribed to ML */
>
> Hello.
>
> I'm trying to replace ipset+iptables setup with pure nft for 200+
> thousand of subnets.
>
> For the list of subnets I create a set in a file:
>
> ===
> add table inet filter
> add set inet filter p2p-paranoid { type ipv4_addr; flags interval; }
> add element inet filter p2p-paranoid {
> 1.0.4.0/22,
> 1.0.64.0/18,
> ...
> here goes 200+ thousand of lines
> ...
> 223.255.128.0/18,
> 223.255.241.132,
> }
> ===
>
> Then I apply this file by "nft -f file". This works fine.
>
> Then I try to list ruleset with "nfs list ruleset", but get segfault:
>
> ===
> Starting program: /usr/bin/nft list ruleset
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000041ef06 in interval_map_decompose (set=0x6f26080) at
> segtree.c:617
> 617 segtree.c: No such file or directory.
> #0 0x000000000041ef06 in interval_map_decompose (set=0x6f26080) at
> segtree.c:617
> #1 0x0000000000418449 in netlink_get_setelems
> (ctx=ctx@entry=0x7fffffff5260, h=h@entry=0x65caa0,
> loc=0x43cf00 <internal_location>, set=set@entry=0x65ca90) at
> netlink.c:1603
> #2 0x0000000000408119 in cache_init_objects (cmd=CMD_LIST,
> ctx=0x7fffffff5260) at rule.c:84
> #3 cache_init (msgs=0x7fffffffe400, cmd=CMD_LIST) at rule.c:130
> #4 cache_update (cmd=cmd@entry=CMD_LIST, msgs=0x7fffffffe400) at
> rule.c:147
> #5 0x0000000000411717 in cmd_evaluate_list (cmd=0x65c730,
> ctx=0x7fffffffe9f8) at evaluate.c:2793
> #6 cmd_evaluate (ctx=ctx@entry=0x7fffffffe9f8, cmd=0x65c730) at
> evaluate.c:3048
> #7 0x000000000042849d in nft_parse (scanner=scanner@entry=0x65c4b0,
> state=state@entry=0x7fffffffe410) at parser_bison.y:626
> #8 0x00000000004064c6 in nft_run (scanner=scanner@entry=0x65c4b0,
> state=state@entry=0x7fffffffe410,
> msgs=msgs@entry=0x7fffffffe400) at main.c:230
> #9 0x00000000004069c2 in main (argc=<optimized out>,
> argv=0x7fffffffec48) at main.c:361
> ===
>
> The same applies to "nft flush ruleset".
>
> According to strace, it seems, nft runs out of stack. Here is the tail
> of strace output:
>
> ===
> brk(0x10b7c000) = 0x10b7c000
> brk(0x10b9d000) = 0x10b9d000
> brk(0x10bbe000) = 0x10bbe000
> brk(0x10bdf000) = 0x10bdf000
> brk(0x10c00000) = 0x10c00000
> brk(0x10c21000) = 0x10c21000
> brk(0x10c42000) = 0x10c42000
> brk(0x10c63000) = 0x10c63000
> --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR,
> si_addr=0x7fffb6554b18} ---
> +++ killed by SIGSEGV (core dumped) +++
> ===
>
> The amount of brk() calls is ~1900.
>
> Could that be addressed, and should I provide more info?
>
> Thanks.
>
> Regards,
> Oleksandr
prev parent reply other threads:[~2017-01-02 10:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-02 10:12 nft segfaults listing huge sets Oleksandr Natalenko
2017-01-02 10:17 ` Oleksandr Natalenko [this message]
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=30e150bbf639585c825f03ce9080429a@natalenko.name \
--to=oleksandr@natalenko.name \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).