netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nftables: segfault in top scope define
@ 2013-11-29 20:30 Phil Oester
  2013-11-30 20:53 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Oester @ 2013-11-29 20:30 UTC (permalink / raw)
  To: netfilter-devel; +Cc: pablo

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

Nftables segfaults if a symbol is added in top_scope, because of a missing
init_list_head.  Trivial example:

    define ip_set = {192.168.1.2, 192.168.2.3}
    add rule filter output ip daddr $ip_set counter

This closes netfilter bugzilla #877.

Reported-by: Anandraj M <anandrm@gmail.com>
Signed-off-by: Phil Oester <kernel@linuxace.com>


[-- Attachment #2: patch-nft-top_scope --]
[-- Type: text/plain, Size: 395 bytes --]

diff --git a/src/parser.y b/src/parser.y
index a49e5c2..c6f8c9d 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -32,6 +32,7 @@ void parser_init(struct parser_state *state, struct list_head *msgs)
 {
 	memset(state, 0, sizeof(*state));
 	init_list_head(&state->cmds);
+	init_list_head(&state->top_scope.symbols);
 	state->msgs = msgs;
 	state->scopes[0] = scope_init(&state->top_scope, NULL);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nftables: segfault in top scope define
  2013-11-29 20:30 [PATCH] nftables: segfault in top scope define Phil Oester
@ 2013-11-30 20:53 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2013-11-30 20:53 UTC (permalink / raw)
  To: Phil Oester; +Cc: netfilter-devel

On Fri, Nov 29, 2013 at 12:30:04PM -0800, Phil Oester wrote:
> Nftables segfaults if a symbol is added in top_scope, because of a missing
> init_list_head.  Trivial example:
> 
>     define ip_set = {192.168.1.2, 192.168.2.3}
>     add rule filter output ip daddr $ip_set counter
> 
> This closes netfilter bugzilla #877.

Applied, thanks Phil!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-30 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-29 20:30 [PATCH] nftables: segfault in top scope define Phil Oester
2013-11-30 20:53 ` Pablo Neira Ayuso

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).