Skip to content

Commit

Permalink
[PATCH] IPoIB: set skb->mac.raw on receive
Browse files Browse the repository at this point in the history
Set skb->mac.raw on receive.  This fixes crashes when this is
dereferenced, for example by netfilter or when PF_PACKET is used.

Signed-off-by: Hal Rosenstock <halr@voltaire.com>
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Hal Rosenstock authored and Linus Torvalds committed Apr 16, 2005
1 parent 48a5346 commit 62241eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev,
if (wc->slid != priv->local_lid ||
wc->src_qp != priv->qp->qp_num) {
skb->protocol = ((struct ipoib_header *) skb->data)->proto;

skb->mac.raw = skb->data;
skb_pull(skb, IPOIB_ENCAP_LEN);

dev->last_rx = jiffies;
Expand Down

0 comments on commit 62241eb

Please sign in to comment.