diff mbox

nftables: segfault in top scope define

Message ID 20131129203003.GA22533@home
State Accepted
Headers show

Commit Message

Phil Oester Nov. 29, 2013, 8:30 p.m. UTC
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>

Comments

Pablo Neira Ayuso Nov. 30, 2013, 8:53 p.m. UTC | #1
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!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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);
 }