summary refs log tree commit diff
path: root/drivers
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2013-08-03 10:45:54 +0000
committerRobert Love <robert.w.love@intel.com>2013-09-04 12:33:08 -0700
commit8b6124345207e4c2141bed78f1bf7c4f526a6d19 (patch)
tree797433c07bf58a5e5c37eb4b07aada7253f28c96 /drivers
parentc0866286f10964e61ec10c8c605ef86e65fbbd38 (diff)
downloadlinux-8b6124345207e4c2141bed78f1bf7c4f526a6d19.tar.gz
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>
Diffstat (limited to 'drivers')
-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,
 			skb_tail_pointer(skb), skb_end_pointer(skb),
 			skb->csum, skb->dev ? skb->dev->name : "<NULL>");
 
+
+	skb = skb_share_check(skb, GFP_ATOMIC);
+
+	if (skb == NULL)
+		return NET_RX_DROP;
+
 	eh = eth_hdr(skb);
 
 	if (is_fip_mode(ctlr) &&