]> err.no Git - linux-2.6/commitdiff
[PATCH] revert "orinoco: Information leakage due to incorrect padding"
authorAndrew Morton <akpm@osdl.org>
Fri, 28 Oct 2005 22:14:51 +0000 (15:14 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 28 Oct 2005 23:06:44 +0000 (19:06 -0400)
Cc: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/wireless/orinoco.c

index d3d4ec9e242e311a16127e635c37585d8fc1d61e..70a3477a20613285c51007ce01b7aa07a7b7fb57 100644 (file)
@@ -490,7 +490,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
                return 0;
        }
 
-       /* Check packet length, pad short packets, round up odd length */
+       /* Length of the packet body */
+       /* FIXME: what if the skb is smaller than this? */
        len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN);
        skb = skb_padto(skb, len);
        if (skb == NULL)
@@ -547,7 +548,8 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
                p = skb->data;
        }
 
-       err = hermes_bap_pwrite(hw, USER_BAP, p, data_len,
+       /* Round up for odd length packets */
+       err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2),
                                txfid, data_off);
        if (err) {
                printk(KERN_ERR "%s: Error %d writing packet to BAP\n",