diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-10-25 05:05:04 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-10-28 06:00:49 -0400 |
commit | 6e7cd27c0f77847f1b07a81ae2ed17b937a7531a (patch) | |
tree | 79de0eab090b710d9135e4317f4ed7dad0d96193 /net/netfilter | |
parent | 6b8dbcf2c44fd7aa716560d04e9857c870bd510c (diff) |
net: ipvs: sctp: add missing verdict assignments in sctp_conn_schedule
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>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto_sctp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c index 23e596e438b3..9ca7aa033284 100644 --- a/net/netfilter/ipvs/ip_vs_proto_sctp.c +++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c | |||
@@ -20,13 +20,18 @@ sctp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd, | |||
20 | sctp_sctphdr_t *sh, _sctph; | 20 | sctp_sctphdr_t *sh, _sctph; |
21 | 21 | ||
22 | sh = skb_header_pointer(skb, iph->len, sizeof(_sctph), &_sctph); | 22 | sh = skb_header_pointer(skb, iph->len, sizeof(_sctph), &_sctph); |
23 | if (sh == NULL) | 23 | if (sh == NULL) { |
24 | *verdict = NF_DROP; | ||
24 | return 0; | 25 | return 0; |
26 | } | ||
25 | 27 | ||
26 | sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t), | 28 | sch = skb_header_pointer(skb, iph->len + sizeof(sctp_sctphdr_t), |
27 | sizeof(_schunkh), &_schunkh); | 29 | sizeof(_schunkh), &_schunkh); |
28 | if (sch == NULL) | 30 | if (sch == NULL) { |
31 | *verdict = NF_DROP; | ||
29 | return 0; | 32 | return 0; |
33 | } | ||
34 | |||
30 | net = skb_net(skb); | 35 | net = skb_net(skb); |
31 | ipvs = net_ipvs(net); | 36 | ipvs = net_ipvs(net); |
32 | rcu_read_lock(); | 37 | rcu_read_lock(); |