[PATCH] IPoIB: set skb->mac.raw on receive
authorHal Rosenstock <halr@voltaire.com>
Sat, 16 Apr 2005 22:26:05 +0000 (15:26 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 22:26:05 +0000 (15:26 -0700)
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>
drivers/infiniband/ulp/ipoib/ipoib_ib.c

index c5a1d45e0ac527f12b7ea0c5b96d6c64f4683019..8238766746b2c1c34d70768167541d7dd113460a 100644 (file)
@@ -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;