Commit b952a29d authored by James Morris's avatar James Morris Committed by David S. Miller

[IPSEC]: fix skb leak in ah and esp.

parent 06d7822a
......@@ -68,8 +68,10 @@ static int ah_output(struct sk_buff *skb)
char buf[60];
} tmp_iph;
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL)
return -EINVAL;
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
err = -EINVAL;
goto error_nolock;
}
spin_lock_bh(&x->lock);
if ((err = xfrm_state_check_expire(x)) != 0)
......
......@@ -32,8 +32,10 @@ int esp_output(struct sk_buff *skb)
} tmp_iph;
/* First, if the skb is not checksummed, complete checksum. */
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL)
return -EINVAL;
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
err = -EINVAL;
goto error_nolock;
}
spin_lock_bh(&x->lock);
if ((err = xfrm_state_check_expire(x)) != 0)
......
......@@ -60,9 +60,11 @@ int ah6_output(struct sk_buff *skb)
struct ah_data *ahp;
u16 nh_offset = 0;
u8 nexthdr;
printk(KERN_DEBUG "%s\n", __FUNCTION__);
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL)
return -EINVAL;
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
err = -EINVAL;
goto error_nolock;
}
spin_lock_bh(&x->lock);
if ((err = xfrm_state_check_expire(x)) != 0)
......
......@@ -118,10 +118,12 @@ int esp6_output(struct sk_buff *skb)
int alen;
int nfrags;
u8 nexthdr;
printk(KERN_DEBUG "%s\n", __FUNCTION__);
/* First, if the skb is not checksummed, complete checksum. */
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL)
return -EINVAL;
if (skb->ip_summed == CHECKSUM_HW && skb_checksum_help(skb) == NULL) {
err = -EINVAL;
goto error_nolock;
}
spin_lock_bh(&x->lock);
if ((err = xfrm_state_check_expire(x)) != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment