: ipv6_skip_exthdr() may refer invalid memory area
Subsystems (4)
PATCH 1/1 : ipv6_skip_exthdr() may refer invalid memory area
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 <[email protected]>
net/ipv6/exthdrs.c +10 -2
@@ -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 )
David S. Miller
AppliedQuoted 4 lines · On Fri, 20 Feb 2004 14:33:59 +0900 (JST) Yasuyuki Kozakai…
ipv6_skip_exthdr()refer invalid memory area in the case that packet includes Fragment Header.please apply this patch.
Applied, thank you Yasuyuki-san.
Hi,
This patch is for linux 2.4.26-pre1 .
-----------------------------------------------------------------
Yasuyuki KOZAKAI @ USAGI Project <[email protected]>
From: "David S. Miller" <[email protected]>
Date: Fri, 20 Feb 2004 09:30:27 -0800
Quoted 9 lines
Quoted 4 lines · On Fri, 20 Feb 2004 14:33:59 +0900 (JST) Yasuyuki Kozakai…
ipv6_skip_exthdr()refer invalid memory area in the case that packet includes Fragment Header.please apply this patch.
Applied, thank you Yasuyuki-san.
net/ipv6/exthdrs.c +10 -2
@@ -798,8 +798,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 )
David S. Miller
AppliedQuoted 1 line · On Thu, 26 Feb 2004 12:48:31 +0900 (JST) Yasuyuki Kozakai…
This patch is for linux 2.4.26-pre1 .
Applied, thank you.