netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: ipv6_skip_exthdr() may refer invalid memory area
@ 2004-02-20  5:33 Yasuyuki Kozakai
  2004-02-20 17:30 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Yasuyuki Kozakai @ 2004-02-20  5:33 UTC (permalink / raw)
  To: netdev; +Cc: netfilter-devel, usagi-core

[-- Attachment #1: Type: Text/Plain, Size: 274 bytes --]


Hello,

ipv6_skip_exthdr() refer invalid memory area in the case
that packet includes Fragment Header.

please apply this patch.

Regards,

-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <yasuyuki.kozakai@toshiba.co.jp>


[-- Attachment #2: linux-2.6.3-skip-exthdr.patch --]
[-- Type: Text/Plain, Size: 728 bytes --]

diff -Nur linux-2.6.3/net/ipv6/exthdrs.c linux-2.6.3-fixed/net/ipv6/exthdrs.c
--- linux-2.6.3/net/ipv6/exthdrs.c	2004-02-18 12:57:13.000000000 +0900
+++ linux-2.6.3-fixed/net/ipv6/exthdrs.c	2004-02-19 18:04:59.000000000 +0900
@@ -709,8 +709,16 @@
 		if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
 			BUG();
 		if (nexthdr == NEXTHDR_FRAGMENT) {
-			struct frag_hdr *fhdr = (struct frag_hdr *) &hdr;
-			if (ntohs(fhdr->frag_off) & ~0x7)
+			unsigned short frag_off;
+			if (skb_copy_bits(skb,
+					  start+offsetof(struct frag_hdr,
+							 frag_off),
+					  &frag_off,
+					  sizeof(frag_off))) {
+				return -1;
+			}
+
+			if (ntohs(frag_off) & ~0x7)
 				break;
 			hdrlen = 8;
 		} else if (nexthdr == NEXTHDR_AUTH)

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

end of thread, other threads:[~2004-02-26 20:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-20  5:33 [PATCH]: ipv6_skip_exthdr() may refer invalid memory area Yasuyuki Kozakai
2004-02-20 17:30 ` David S. Miller
2004-02-26  3:48   ` Yasuyuki Kozakai
2004-02-26 20:37     ` David S. Miller

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).