Skip to content

Commit

Permalink
net: ipvs: sctp: add missing verdict assignments in sctp_conn_schedule
Browse files Browse the repository at this point in the history
If skb_header_pointer() fails, we need to assign a verdict, that is
NF_DROP in this case, otherwise, we would leave the verdict from
conn_schedule() uninitialized when returning.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
  • Loading branch information
Daniel Borkmann authored and Simon Horman committed Oct 28, 2013
1 parent 6b8dbcf commit 6e7cd27
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net/netfilter/ipvs/ip_vs_proto_sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
sctp_sctphdr_t *sh, _sctph;

sh = skb_header_pointer(skb, iph->len, sizeof(_sctph), &_sctph);
if (sh == NULL)
if (sh == NULL) {
*verdict = NF_DROP;
return 0;
}

sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t),
sizeof(_schunkh), &_schunkh);
if (sch == NULL)
if (sch == NULL) {
*verdict = NF_DROP;
return 0;
}

net = skb_net(skb);
ipvs = net_ipvs(net);
rcu_read_lock();
Expand Down

0 comments on commit 6e7cd27

Please sign in to comment.