Commit 62241eb4 authored by Hal Rosenstock's avatar Hal Rosenstock Committed by Linus Torvalds

[PATCH] IPoIB: set skb->mac.raw on receive

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: default avatarHal Rosenstock <halr@voltaire.com>
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 48a5346b
...@@ -201,7 +201,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev, ...@@ -201,7 +201,7 @@ static void ipoib_ib_handle_wc(struct net_device *dev,
if (wc->slid != priv->local_lid || if (wc->slid != priv->local_lid ||
wc->src_qp != priv->qp->qp_num) { wc->src_qp != priv->qp->qp_num) {
skb->protocol = ((struct ipoib_header *) skb->data)->proto; skb->protocol = ((struct ipoib_header *) skb->data)->proto;
skb->mac.raw = skb->data;
skb_pull(skb, IPOIB_ENCAP_LEN); skb_pull(skb, IPOIB_ENCAP_LEN);
dev->last_rx = jiffies; dev->last_rx = jiffies;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment