Commit 98af046c authored by Tomas Szepe's avatar Tomas Szepe Committed by David S. Miller

[NET]: Protect secpath references in skbuff.c with CONFIG_INET.

parent a773eb63
...@@ -324,7 +324,9 @@ void __kfree_skb(struct sk_buff *skb) ...@@ -324,7 +324,9 @@ void __kfree_skb(struct sk_buff *skb)
} }
dst_release(skb->dst); dst_release(skb->dst);
#ifdef CONFIG_INET
secpath_put(skb->sp); secpath_put(skb->sp);
#endif
if(skb->destructor) { if(skb->destructor) {
if (in_irq()) if (in_irq())
printk(KERN_WARNING "Warning: kfree_skb on " printk(KERN_WARNING "Warning: kfree_skb on "
...@@ -378,7 +380,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, int gfp_mask) ...@@ -378,7 +380,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, int gfp_mask)
C(dst); C(dst);
dst_clone(n->dst); dst_clone(n->dst);
C(sp); C(sp);
#ifdef CONFIG_INET
secpath_get(n->sp); secpath_get(n->sp);
#endif
memcpy(n->cb, skb->cb, sizeof(skb->cb)); memcpy(n->cb, skb->cb, sizeof(skb->cb));
C(len); C(len);
C(data_len); C(data_len);
...@@ -438,7 +442,9 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) ...@@ -438,7 +442,9 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
new->priority = old->priority; new->priority = old->priority;
new->protocol = old->protocol; new->protocol = old->protocol;
new->dst = dst_clone(old->dst); new->dst = dst_clone(old->dst);
#ifdef CONFIG_INET
new->sp = secpath_get(old->sp); new->sp = secpath_get(old->sp);
#endif
new->h.raw = old->h.raw + offset; new->h.raw = old->h.raw + offset;
new->nh.raw = old->nh.raw + offset; new->nh.raw = old->nh.raw + offset;
new->mac.raw = old->mac.raw + offset; new->mac.raw = old->mac.raw + offset;
......
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