From: Ed L Cashin <ecashin@coraid.com>
To: Valdis.Kletnieks@vt.edu
Cc: linux-kernel@vger.kernel.org, Greg K-H <greg@kroah.com>
Subject: Re: [PATCH 2.6.14-rc2] aoe [1/2]: explicitly set minimum packet length to ETH_ZLEN
Date: Mon, 26 Sep 2005 18:28:39 -0400 [thread overview]
Message-ID: <87vf0npip4.fsf@coraid.com> (raw)
In-Reply-To: <200509261710.j8QHAkE7008871@turing-police.cc.vt.edu> (Valdis Kletnieks's message of "Mon, 26 Sep 2005 13:10:46 -0400")
Valdis.Kletnieks@vt.edu writes:
...
> I haven't chased through the code in detail - will this change ensure that
> all ETH_ZLEN bytes are initialized? We had a bunch of drivers a few years
> ago that set the length to the legal min, but then only copied some smaller
> number of bytes in, resulting in leakage of kernel memory contents....
No, it looks like alloc_skb just kmallocs the data, so I'd need to
follow up with something like this:
diff -rN -u old-aoe-2.6-stand/linux/drivers/block/aoe/aoecmd.c new-aoe-2.6-stand/linux/drivers/block/aoe/aoecmd.c
--- old-aoe-2.6-stand/linux/drivers/block/aoe/aoecmd.c 2005-09-26 18:25:19.000000000 -0400
+++ new-aoe-2.6-stand/linux/drivers/block/aoe/aoecmd.c 2005-09-26 17:08:21.000000000 -0400
@@ -26,6 +26,7 @@
skb = alloc_skb(len, GFP_ATOMIC);
if (skb) {
+ memset(skb->head, 0, skb->end - skb->head);
skb->nh.raw = skb->mac.raw = skb->data;
skb->dev = if_dev;
skb->protocol = __constant_htons(ETH_P_AOE);
--
Ed L Cashin <ecashin@coraid.com>
next prev parent reply other threads:[~2005-09-26 22:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-26 16:43 [PATCH 2.6.14-rc2] aoe [1/2]: explicitly set minimum packet length to ETH_ZLEN Ed L. Cashin
2005-09-26 16:45 ` [PATCH 2.6.14-rc2] aoe [2/2]: use get_unaligned for possibly unaligned accesses in ATA id buffer Ed L. Cashin
2005-09-26 21:55 ` David S. Miller
2005-09-26 16:50 ` [PATCH 2.6.14-rc2] aoe [1/2]: explicitly set minimum packet length to ETH_ZLEN Ed L Cashin
2005-09-26 17:10 ` Valdis.Kletnieks
2005-09-26 17:25 ` Randy.Dunlap
2005-09-26 22:28 ` Ed L Cashin [this message]
2005-09-26 23:21 ` David S. Miller
2005-09-27 21:41 ` Ed L Cashin
2005-09-26 17:14 ` Ben Dooks
2005-09-26 18:05 ` Alan Cox
2005-09-26 19:09 ` Ed L Cashin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vf0npip4.fsf@coraid.com \
--to=ecashin@coraid.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox