Skip to content

Commit 60e1951

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for your net tree. More specifically, they are: 1) Fix missing filter table per-netns registration in arptables, from Florian Westphal. 2) Resolve out of bound access when parsing TCP options in nf_conntrack_tcp, patch from Jozsef Kadlecsik. 3) Prefer NFPROTO_BRIDGE extensions over NFPROTO_UNSPEC in ebtables, this resolves conflict between xt_limit and ebt_limit, from Phil Sutter. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4bc0eb3 + bcf4934 commit 60e1951

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

net/bridge/netfilter/ebtables.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,11 @@ ebt_check_match(struct ebt_entry_match *m, struct xt_mtchk_param *par,
370370
left - sizeof(struct ebt_entry_match) < m->match_size)
371371
return -EINVAL;
372372

373-
match = xt_request_find_match(NFPROTO_BRIDGE, m->u.name, 0);
373+
match = xt_find_match(NFPROTO_BRIDGE, m->u.name, 0);
374+
if (IS_ERR(match) || match->family != NFPROTO_BRIDGE) {
375+
request_module("ebt_%s", m->u.name);
376+
match = xt_find_match(NFPROTO_BRIDGE, m->u.name, 0);
377+
}
374378
if (IS_ERR(match))
375379
return PTR_ERR(match);
376380
m->u.match = match;

net/ipv4/netfilter/arptable_filter.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ static int __init arptable_filter_init(void)
8181
return ret;
8282
}
8383

84+
ret = arptable_filter_table_init(&init_net);
85+
if (ret) {
86+
unregister_pernet_subsys(&arptable_filter_net_ops);
87+
kfree(arpfilter_ops);
88+
}
89+
8490
return ret;
8591
}
8692

net/netfilter/nf_conntrack_proto_tcp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ static void tcp_options(const struct sk_buff *skb,
410410
length--;
411411
continue;
412412
default:
413+
if (length < 2)
414+
return;
413415
opsize=*ptr++;
414416
if (opsize < 2) /* "silly options" */
415417
return;
@@ -470,6 +472,8 @@ static void tcp_sack(const struct sk_buff *skb, unsigned int dataoff,
470472
length--;
471473
continue;
472474
default:
475+
if (length < 2)
476+
return;
473477
opsize = *ptr++;
474478
if (opsize < 2) /* "silly options" */
475479
return;

0 commit comments

Comments
 (0)