Skip to contentSkip to conversation

nftables: segfault in top scope define

PATCH Applied Phil Oester 2 participants 2 messages Nov 29, 2013 – Nov 30, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nftables: segfault in top scope define

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.

src/parser.y +1 -0
index a49e5c2..c6f8c9d 100644
@@ -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);
 }
maintainer Applied
#1 lore raw
Quoted 7 lines · Phil Oester

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!