<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>99487</bug_id>
          
          <creation_ts>2005-07-18 23:16 0000</creation_ts>
          <short_desc>iproute2 2.6.11.20050330 stack overflow in netem/paretonormal.c</short_desc>
          <delta_ts>2007-04-12 12:02:46 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Core system</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>TEST-REQUEST</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dirk.heinrichs.ext@nsn.com</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          <cc>casta@xwing.info</cc>
    
    <cc>castan.o@free.fr</cc>
    
    <cc>creideiki+gentoo-bugzilla@lysator.liu.se</cc>
    
    <cc>david+gentoo.org@blue-labs.org</cc>
    
    <cc>howard_b_golden@yahoo.com</cc>
    
    <cc>ikelos@gentoo.org</cc>
    
    <cc>scottfk@yahoo.com</cc>
    
    <cc>taviso@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>dirk.heinrichs.ext@nsn.com</who>
            <bug_when>2005-07-18 23:16:30 0000</bug_when>
            <thetext>gcc -D_GNU_SOURCE -march=pentium3 -O2 -pipe -fomit-frame-pointer 
-Wstrict-prototypes -Wall -I../include -DRESOLVE_HOSTNAMES -o paretonormal 
paretonormal.c -lm 
./paretonormal &gt;paretonormal.dist 
paretonormal: stack smashing attack in function main() 
/bin/sh: line 1:  3238 Aborted                 ./paretonormal 
&gt;paretonormal.dist 
make[1]: *** [paretonormal.dist] Error 134 
make[1]: Leaving directory 
`/gentoo/build/portage/iproute2-2.6.11.20050330/work/iproute2-2.6.11-050330/netem&apos; 
make: *** [all] Error 2 
 
!!! ERROR: sys-apps/iproute2-2.6.11.20050330 failed. 
 

Reproducible: Always
Steps to Reproduce:
emerge iproute2 
Actual Results:  
 


Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r0, 
2.6.11.12 i686) 
================================================================= 
System uname: 2.6.11.12 i686 Pentium III (Katmai) 
Gentoo Base System version 1.6.13 
dev-lang/python:     2.3.5, 2.4.1-r1 
sys-apps/sandbox:    1.2.11 
sys-devel/autoconf:  2.13, 2.59-r7 
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 
sys-devel/binutils:  2.16.1 
sys-devel/libtool:   1.5.18-r1 
virtual/os-headers:  2.6.11-r2 
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot; 
AUTOCLEAN=&quot;yes&quot; 
CBUILD=&quot;i686-pc-linux-gnu&quot; 
CFLAGS=&quot;-march=pentium3 -O2 -pipe -fomit-frame-pointer&quot; 
CHOST=&quot;i686-pc-linux-gnu&quot; 
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control&quot; 
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d&quot; 
CXXFLAGS=&quot;-march=pentium3 -O2 -pipe -fomit-frame-pointer&quot; 
DISTDIR=&quot;/gentoo/distfiles&quot; 
FEATURES=&quot;autoconfig distlocks sandbox sfperms strict&quot; 
GENTOO_MIRRORS=&quot;ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ 
ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ 
http://ftp.easynet.nl/mirror/gentoo/ 
http://ftp.snt.utwente.nl/pub/os/linux/gentoo 
http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://gentoo.osuosl.org&quot; 
LINGUAS=&quot;de&quot; 
MAKEOPTS=&quot;&quot; 
PKGDIR=&quot;/usr/portage/packages&quot; 
PORTAGE_TMPDIR=&quot;/gentoo/build&quot; 
PORTDIR=&quot;/usr/portage&quot; 
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot; 
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot; 
USE=&quot;x86 X Xaw3d acl alsa arts athena autofs avi bash-completion berkdb 
bitmap-fonts bzlib caps cdr crypt cups dga dlloader dnd emacs emboss encode 
exif fam fbcon font-server foomaticdb gif gpm gtk gtk2 hardened imagemagick 
imap imlib jpeg kde kdexdeltas largeterminal lcms ldap libg++ libwww 
logitech-mouse maildir mbox mcal motif mozcalendar moznocompose moznoirc 
mozsvg mp3 mpeg mule ncurses nls nntp nodroproot nptl nptlonly ogg oggvorbis 
ooo-kde opengl pam parse-clocks pcre pdflib perl perlsuid pic pie png posix 
ppds pwdb python qt quicktime readline samba sasl savedconfig serial slang 
smime socks5 spell sse ssl swig symlink tcltk tcpd tetex threads tiff truetype 
truetype-fonts type1-fonts usb vim-with-x vorbis wmf wxwindows xml2 xprint xv 
zlib linguas_de userland_GNU kernel_linux elibc_glibc&quot; 
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>casta@xwing.info</who>
            <bug_when>2005-07-19 02:08:12 0000</bug_when>
            <thetext>Same error here but with a grsec/hardened system :

./paretonormal &gt;paretonormal.dist
paretonormal: stack smashing attack in function main()
Jul 19 10:43:18 xwing grsec: From 83.197.2.247: signal 6 sent to
/var/tmp/portage/iproute2-2.6.11.20050330/work/iproute2-2.6.11-050330/netem/paretonormal[paretonormal:1419]
uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:6115] uid/euid:0/0 gid/egid:0/0
Jul 19 10:43:18 xwing grsec: From 83.197.2.247: signal 6 sent to
/var/tmp/portage/iproute2-2.6.11.20050330/work/iproute2-2.6.11-050330/netem/paretonormal[paretonormal:1419]
uid/euid:0/0 gid/egid:0/0, parent /bin/bash[sh:6115] uid/euid:0/0 gid/egid:0/0

===========================

Portage 2.0.51.22-r1 (hardened/x86/2.6, gcc-3.4.4, glibc-2.3.5-r0,
2.6.11-xwing-r3 i686)
=================================================================
System uname: 2.6.11-xwing-r3 i686 Intel(R) Celeron(R) CPU 2.53GHz
Gentoo Base System version 1.6.13
dev-lang/python:     2.4.1-r1
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-march=pentium4 -O2 -mtune=pentium4 -fomit-frame-pointer -funroll-loops
-pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/bind /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-march=pentium4 -O2 -mtune=pentium4 -fomit-frame-pointer
-funroll-loops -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig buildsyspkg candy ccache distlocks sandbox sfperms strict
userpriv usersandbox&quot;
GENTOO_MIRRORS=&quot;http://mirror.switch.ch/ftp/mirror/gentoo/
http://ftp.gentoo.skynet.be/pub/gentoo/
http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/&quot;
LANG=&quot;fr_FR.UTF-8&quot;
LC_ALL=&quot;fr_FR.UTF-8&quot;
LINGUAS=&quot;fr&quot;
PKGDIR=&quot;/usr/portage//packages/x86/&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage/&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 4kstacks X509 acl acpi acpi4linux apache2 bash-completion berkdb clamav
crypt dba dbx dga dlloader enscript extensions fbcon freetype fs gd gdbm gif
hardened idled imagemagick imap imlib2 ipv6 ithreads jpeg maildir md5sum mmx
mysql ncurses nls nptl nptlonly pam perl pic png prelude print python readline
rrdtool samba sasl slang smartcard sqlite sse sse2 ssl tcpd threads tiff
truetype truetype-fonts type1 type1-fonts unicode usb userlocales xml2 zlib
linguas_fr userland_GNU kernel_linux elibc_glibc&quot;
Unset:  ASFLAGS, CTARGET, LDFLAGS, MAKEOPTS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-07-19 05:01:26 0000</bug_when>
            <thetext>paretonormal.c:58:Bounds error: array reference (16384) outside bounds of the array.
paretonormal.c:58:  Pointer value: 0x5897e5d0
paretonormal.c:58:  Object `table&apos;:
paretonormal.c:58:    Address in memory:    0x5895e5d0 .. 0x5897e5cf
paretonormal.c:58:    Size:                 131072 bytes
paretonormal.c:58:    Element size:         8 bytes
paretonormal.c:58:    Number of elements:   16384
paretonormal.c:58:    Created at:           paretonormal.c, line 54
paretonormal.c:58:    Storage class:        stack

-----------------------------------
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-07-19 05:04:26 0000</bug_when>
            <thetext>Created an attachment (id=63771)
iproute2-paretonormal-overflow.patch

patch to keep paretonormal from overflowing on itself.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-07-19 05:08:53 0000</bug_when>
            <thetext>Taviso here is a local stack overflow.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-07-19 05:25:36 0000</bug_when>
            <thetext>Here is another one.

maketable.c:152:Bounds error: attempt to reference memory overrunning the end of
an object.
maketable.c:152:  Pointer value: 0x14049000, Size: 2
maketable.c:152:  Object `malloc&apos;:
maketable.c:152:    Address in memory:    0x14047000 .. 0x14048fff
maketable.c:152:    Size:                 8192 bytes
maketable.c:152:    Element size:         1 bytes
maketable.c:152:    Number of elements:   8192
maketable.c:152:    Created at:           maketable.c, line 141
maketable.c:152:    Storage class:        heap
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-07-19 19:04:04 0000</bug_when>
            <thetext>latest snapshot (dated Jun 06) seems to have this issue too

e-mailed iproute2 dev about the issue</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-07-19 19:05:14 0000</bug_when>
            <thetext>just to note, this isnt a security issue because none of the netem utilites are
actually installed ... they are used to generate some data tables and the tables
are installed</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo-bugs@seyffer.de</who>
            <bug_when>2005-08-08 08:25:54 0000</bug_when>
            <thetext>Solar, your patch works fine here. Thanks. :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jontodaro@gmail.com</who>
            <bug_when>2005-08-09 13:35:04 0000</bug_when>
            <thetext>Any date when this will be implemented into the portage tree?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-08-09 15:33:52 0000</bug_when>
            <thetext>i expected to hear back from the iproute2 maintainer but that hasnt happened ...

ive added the patch here to the build but that still doesnt address maketable.c</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>scottfk@yahoo.com</who>
            <bug_when>2005-08-19 09:15:57 0000</bug_when>
            <thetext>Created an attachment (id=66325)
an ebuild for the latest iproute2 release

The latest release from http://developer.osdl.org/dev/iproute2/download/ with
the same Gentoo patches as iproute2-2.6.11.20050330.ebuild.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>scottfk@yahoo.com</who>
            <bug_when>2005-08-19 09:17:29 0000</bug_when>
            <thetext>I&apos;ve posted an ebuild for the latest (050816) release of iproute2.  It compiles
clean for me.

Maybe this is what the iproute2 maintainer has been waiting for, an upstream fix.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-04-01 20:47:04 0000</bug_when>
            <thetext>Stale bug, reopen if you have the same problem w/ uptodate versions. Thanks.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>63771</attachid>
            <date>2005-07-19 05:04 0000</date>
            <desc>iproute2-paretonormal-overflow.patch</desc>
            <filename>iproute2-paretonormal-overflow.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIG5ldGVtL3BhcmV0b25vcm1hbC5jCTIwMDUtMDctMTkgMDc6NTg6MjYuMDAwMDAwMDAwIC0w
NDAwCisrKyBuZXRlbS9wYXJldG9ub3JtYWwuYwkyMDA1LTA3LTE5IDA3OjU5OjAxLjAwMDAwMDAw
MCAtMDQwMApAQCAtNTUsNiArNTUsNyBAQAogCiAJZm9yICh4ID0gLTEwLjA7IHggPCAxMC4wNTsg
eCArPSAuMDAwMDUpIHsKIAkJaSA9IHJpbnQoVEFCTEVTSVpFKm5vcm1hbCh4LCAwLjAsIDEuMCkp
OworCQlpZiAoaSA+PSBUQUJMRVNJWkUpIGJyZWFrOwogCQl0YWJsZVtpXSA9IHg7CiAJfQogCXBy
aW50ZigK
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>66325</attachid>
            <date>2005-08-19 09:15 0000</date>
            <desc>an ebuild for the latest iproute2 release</desc>
            <filename>iproute2-050816.ebuild</filename>
            <type>text/plain</type>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