Skip to content

Commit

Permalink
fcoe: make sure fcoe frames are unshared prior to manipulating them
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Neil Horman authored and Robert Love committed Sep 4, 2013
1 parent c086628 commit 8b61243
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/fcoe/fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit 8b61243

Please sign in to comment.