From: Neil Horman Date: Sat, 3 Aug 2013 10:45:54 +0000 (+0000) Subject: fcoe: make sure fcoe frames are unshared prior to manipulating them X-Git-Tag: v3.13-rc1~99^2^2~17 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=8b6124345207e4c2141bed78f1bf7c4f526a6d19;p=cascardo%2Flinux.git fcoe: make sure fcoe frames are unshared prior to manipulating them Based on my last patch I noticed that fcoe_rcv has a simmilar problem, in that it manipulates the passed in skb without checking to see if it has other users. Making manipulations to a shared skb can result in various corruptions. Easy fix, just make sure the skb is unshared prior to doing anything with it. Signed-off-by: Neil Horman Signed-off-by: Robert Love --- diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 07453bbf05e7..f9b0302f9ba2 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -1452,6 +1452,12 @@ static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, skb_tail_pointer(skb), skb_end_pointer(skb), skb->csum, skb->dev ? skb->dev->name : ""); + + skb = skb_share_check(skb, GFP_ATOMIC); + + if (skb == NULL) + return NET_RX_DROP; + eh = eth_hdr(skb); if (is_fip_mode(ctlr) &&