From: Hal Rosenstock Date: Sat, 16 Apr 2005 22:26:05 +0000 (-0700) Subject: [PATCH] IPoIB: set skb->mac.raw on receive X-Git-Tag: v2.6.12-rc3~92 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62241eb497721be7640e5d9330e60f4a88a4db46;p=linux-2.6 [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: Hal Rosenstock Signed-off-by: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index c5a1d45e0a..8238766746 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -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;