aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/ipv6.c
diff options
context:
space:
mode:
authorSridhar Samudrala <sri@us.ibm.com>2005-07-18 16:44:10 -0400
committerDavid S. Miller <davem@davemloft.net>2005-07-18 16:44:10 -0400
commitd1ad1ff299dd908d07c5e5f27f88bbdb235eb7a5 (patch)
tree03f66679f4a153ec06fde913907f392503f4b5e5 /net/sctp/ipv6.c
parentee71a29eb5e341fe977c5ad7a43782c29bd9cb9e (diff)
[SCTP]: Fix potential null pointer dereference while handling an icmp error
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/ipv6.c')
-rw-r--r--net/sctp/ipv6.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index c7e42d125b9c..e9b2fd480d61 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -91,7 +91,6 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
91 struct ipv6hdr *iph = (struct ipv6hdr *)skb->data; 91 struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
92 struct sctphdr *sh = (struct sctphdr *)(skb->data + offset); 92 struct sctphdr *sh = (struct sctphdr *)(skb->data + offset);
93 struct sock *sk; 93 struct sock *sk;
94 struct sctp_endpoint *ep;
95 struct sctp_association *asoc; 94 struct sctp_association *asoc;
96 struct sctp_transport *transport; 95 struct sctp_transport *transport;
97 struct ipv6_pinfo *np; 96 struct ipv6_pinfo *np;
@@ -105,7 +104,7 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
105 savesctp = skb->h.raw; 104 savesctp = skb->h.raw;
106 skb->nh.ipv6h = iph; 105 skb->nh.ipv6h = iph;
107 skb->h.raw = (char *)sh; 106 skb->h.raw = (char *)sh;
108 sk = sctp_err_lookup(AF_INET6, skb, sh, &ep, &asoc, &transport); 107 sk = sctp_err_lookup(AF_INET6, skb, sh, &asoc, &transport);
109 /* Put back, the original pointers. */ 108 /* Put back, the original pointers. */
110 skb->nh.raw = saveip; 109 skb->nh.raw = saveip;
111 skb->h.raw = savesctp; 110 skb->h.raw = savesctp;
@@ -124,7 +123,7 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
124 goto out_unlock; 123 goto out_unlock;
125 case ICMPV6_PARAMPROB: 124 case ICMPV6_PARAMPROB:
126 if (ICMPV6_UNK_NEXTHDR == code) { 125 if (ICMPV6_UNK_NEXTHDR == code) {
127 sctp_icmp_proto_unreachable(sk, ep, asoc, transport); 126 sctp_icmp_proto_unreachable(sk, asoc, transport);
128 goto out_unlock; 127 goto out_unlock;
129 } 128 }
130 break; 129 break;
@@ -142,7 +141,7 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
142 } 141 }
143 142
144out_unlock: 143out_unlock:
145 sctp_err_finish(sk, ep, asoc); 144 sctp_err_finish(sk, asoc);
146out: 145out:
147 if (likely(idev != NULL)) 146 if (likely(idev != NULL))
148 in6_dev_put(idev); 147 in6_dev_put(idev);