aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2013-08-03 06:45:54 -0400
committerRobert Love <robert.w.love@intel.com>2013-09-04 15:33:08 -0400
commit8b6124345207e4c2141bed78f1bf7c4f526a6d19 (patch)
tree797433c07bf58a5e5c37eb4b07aada7253f28c96
parentc0866286f10964e61ec10c8c605ef86e65fbbd38 (diff)
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 <nhorman@tuxdriver.com> Signed-off-by: Robert Love <robert.w.love@intel.com>
-rw-r--r--drivers/scsi/fcoe/fcoe.c6
1 files changed, 6 insertions, 0 deletions
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,
1452 skb_tail_pointer(skb), skb_end_pointer(skb), 1452 skb_tail_pointer(skb), skb_end_pointer(skb),
1453 skb->csum, skb->dev ? skb->dev->name : "<NULL>"); 1453 skb->csum, skb->dev ? skb->dev->name : "<NULL>");
1454 1454
1455
1456 skb = skb_share_check(skb, GFP_ATOMIC);
1457
1458 if (skb == NULL)
1459 return NET_RX_DROP;
1460
1455 eh = eth_hdr(skb); 1461 eh = eth_hdr(skb);
1456 1462
1457 if (is_fip_mode(ctlr) && 1463 if (is_fip_mode(ctlr) &&