netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH SECURITY]: orinoco: Information leakage due to incorrect padding
@ 2005-10-05  1:33 Pavel Roskin
  2005-10-07  3:25 ` Jouni Malinen
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Roskin @ 2005-10-05  1:33 UTC (permalink / raw)
  To: orinoco-devel, NetDev; +Cc: Meder Kydyraliev

orinoco: Information leakage due to incorrect padding

The orinoco driver can send uninitialized data exposing random pieces of
the system memory.  This happens because data is not padded with zeroes
when its length needs to be increased.

Reported by Meder Kydyraliev <meder-ljIgrh4ImVw@public.gmane.org>

Please try to get it to Linux 2.6.14 and maybe even 2.6.13.y.  It's a
security issue.

Signed-off-by: Pavel Roskin <proski-mXXj517/zsQ@public.gmane.org>

diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -490,9 +490,14 @@ static int orinoco_xmit(struct sk_buff *
 		return 0;
 	}
 
-	/* Length of the packet body */
-	/* FIXME: what if the skb is smaller than this? */
-	len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN);
+	/* Check packet length, pad short packets, round up odd length */
+	len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN);
+	if (skb->len < len) {
+		skb = skb_padto(skb, len);
+		if (skb == NULL)
+			goto fail;
+	}
+	len -= ETH_HLEN;
 
 	eh = (struct ethhdr *)skb->data;
 
@@ -544,8 +549,7 @@ static int orinoco_xmit(struct sk_buff *
 		p = skb->data;
 	}
 
-	/* Round up for odd length packets */
-	err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2),
+	err = hermes_bap_pwrite(hw, USER_BAP, p, data_len,
 				txfid, data_off);
 	if (err) {
 		printk(KERN_ERR "%s: Error %d writing packet to BAP\n",


-- 
Regards,
Pavel Roskin



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-07 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-05  1:33 [PATCH SECURITY]: orinoco: Information leakage due to incorrect padding Pavel Roskin
2005-10-07  3:25 ` Jouni Malinen
     [not found]   ` <20051007032537.GB3936-mgr6C1c9aYeHXe+LvDLADg@public.gmane.org>
2005-10-07 13:39     ` Pavel Roskin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).