<?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>183844</bug_id>
          
          <creation_ts>2007-07-01 15:29 0000</creation_ts>
          <short_desc>sys-libs/glibc: integer overflow in ld.so CVE-2007-3508</short_desc>
          <delta_ts>2007-09-12 05:19:41 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <status_whiteboard>A1 [glsa]</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>taviso@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>caluml@gmail.com</cc>
    
    <cc>gengor@gentoo.org</cc>
    
    <cc>ssuominen@gentoo.org</cc>
    
    <cc>toolchain@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2007-07-01 15:29:48 0000</bug_when>
            <thetext>When there are many bits set in LD_HWCAP_MASK, an integer overflow could result in too little memory being allocated, potentially resulting in an exploitable condition.

Reproduce:

$ env -i LD_HWCAP_MASK=$((0xffffffff)) su
$ strace -emmap2 -f env -i LD_HWCAP_MASK=$((0x7fffffff)) su

As hwcap_mask is honoured for suid binaries, this is a security issue. Attached patch disabled this, as some other distributions have already done (eg, Owl).

Vapier, could you prepare an updated ebuild incorporating this patch? Please dont commit it to portage yet, as this issue may require an embargo.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2007-07-01 15:30:21 0000</bug_when>
            <thetext>Created an attachment (id=123536)
ignore HWCAP_MASK for suid/sgid

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2007-07-02 21:54:28 0000</bug_when>
            <thetext>this is CVE-2007-3508.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2007-07-03 03:13:22 0000</bug_when>
            <thetext>This is in the tree now as -r4 per a taviso request.

solar@hangover / $ LD_HWCAP_MASK=$((0xffffffff)) id
Inconsistency detected by ld.so: dl-minimal.c: 84: __libc_memalign: Assertion `page != ((void *) -1)&apos; failed!
solar@hangover / $ LD_HWCAP_MASK=$((0xffffffff)) su
Password:

http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.5/ as patch 1600</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2007-07-03 09:21:59 0000</bug_when>
            <thetext>x86: Please test and mark stable sys-libs/glibc-2.5-r4, in particular, please ensure that the following command succeeds:

$ env -i LD_HWCAP_MASK=$((0xffffffff)) su</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2007-07-03 13:09:50 0000</bug_when>
            <thetext>x86 stable, changing status to glsa?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eradicator@gentoo.org</who>
            <bug_when>2007-07-04 08:51:42 0000</bug_when>
            <thetext>Shouldn&apos;t amd64 be marking this stable too before you do the glsa...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caluml@gmail.com</who>
            <bug_when>2007-07-05 09:11:04 0000</bug_when>
            <thetext>Is there any chance of having a 2.3 and 2.4 version of Glibc made available for this - some binary packages (HelixServer for instance) have problems with some versions of glibc, and if you have to run them, it&apos;d be nice to be able to run them on a secure version of glibc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2007-07-05 10:07:53 0000</bug_when>
            <thetext>Jeremy: we believe only x86 is affected, a 64bit arch like amd64 should be safe
Calum: This only affects suid applications, so unless your server is setuid, this shouldnt affect you</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caluml@gmail.com</who>
            <bug_when>2007-07-05 10:35:47 0000</bug_when>
            <thetext>Aaah, thanks for the reply.

Doesn&apos;t it mean though that someone could use a &quot;standard&quot; suid program such as su/mount/passwd to gain root though?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-07-05 21:06:53 0000</bug_when>
            <thetext>what&apos;s the upstream status ?  has anyone posted there ?  if not, i&apos;ll take it up</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2007-07-06 09:10:35 0000</bug_when>
            <thetext>GLSA 200707-04</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2007-07-06 11:39:25 0000</bug_when>
            <thetext>Vapier: Yep, it&apos;s fixed in upstream CVS

http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?r1=1.10688&amp;r2=1.10689&amp;cvsroot=glibc&amp;sortby=date

(they fixed the bug, rather than just blacklisting it for suid)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-07-06 15:26:25 0000</bug_when>
            <thetext>ok, i checked for the mask rather than the fix ... i&apos;ll update our patches to match upstream ... thanks</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-07-07 04:13:31 0000</bug_when>
            <thetext>considering all arches parse glsa&apos;s, i think all should stabilize ... especially since it&apos;s pretty trivial/non-invasive</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>corsair@gentoo.org</who>
            <bug_when>2007-07-07 13:12:29 0000</bug_when>
            <thetext>ppc64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>corsair@gentoo.org</who>
            <bug_when>2007-07-07 13:13:19 0000</bug_when>
            <thetext>reopening bug, so this pops up in bug lists of stable marking monkeys ^^</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2007-07-07 14:35:01 0000</bug_when>
            <thetext>alpha/ia64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kumba@gentoo.org</who>
            <bug_when>2007-07-07 16:19:26 0000</bug_when>
            <thetext>mips stable.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eradicator@gentoo.org</who>
            <bug_when>2007-07-08 15:42:54 0000</bug_when>
            <thetext>(In reply to comment #8)
&gt; Jeremy: we believe only x86 is affected, a 64bit arch like amd64 should be safe

32bit suid apps on amd64 are affected though...

$ env -i LD_HWCAP_MASK=$((0xffffffff)) /mnt/gentoo32/bin/su
Segmentation fault

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jer@gentoo.org</who>
            <bug_when>2007-07-09 04:03:08 0000</bug_when>
            <thetext>Stable for HPPA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gustavoz@gentoo.org</who>
            <bug_when>2007-07-10 12:25:19 0000</bug_when>
            <thetext>sparc stable.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2007-07-10 18:41:02 0000</bug_when>
            <thetext>ppc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>angelos@gentoo.org</who>
            <bug_when>2007-07-15 12:11:30 0000</bug_when>
            <thetext>amd64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2007-09-11 22:24:39 0000</bug_when>
            <thetext>Any reason this is still open?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-09-12 05:19:41 0000</bug_when>
            <thetext>I don&apos;t think so.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>123536</attachid>
            <date>2007-07-01 15:30 0000</date>
            <desc>ignore HWCAP_MASK for suid/sgid</desc>
            <filename>glibc-hwcap-mask-secure.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">ZGlmZiAtcnVOcCBlbGYvcnRsZC5jIGVsZi9ydGxkLmMKLS0tIGVsZi9ydGxkLmMJMjAwNy0wNy0w
MSAxNjoyMTo1NS4wMDAwMDAwMDAgKzAxMDAKKysrIGVsZi9ydGxkLmMJMjAwNy0wNy0wMSAxNjoy
MDozOC4wMDAwMDAwMDAgKzAxMDAKQEAgLTI1ODcsNyArMjU4Nyw4IEBAIHByb2Nlc3NfZW52dmFy
cyAoZW51bSBtb2RlICptb2RlcCkKIAogCWNhc2UgMTA6CiAJICAvKiBNYXNrIGZvciB0aGUgaW1w
b3J0YW50IGhhcmR3YXJlIGNhcGFiaWxpdGllcy4gICovCi0JICBpZiAobWVtY21wIChlbnZsaW5l
LCAiSFdDQVBfTUFTSyIsIDEwKSA9PSAwKQorCSAgaWYgKCFJTlRVU0UoX19saWJjX2VuYWJsZV9z
ZWN1cmUpCisgICAgICAgICAgJiYgbWVtY21wIChlbnZsaW5lLCAiSFdDQVBfTUFTSyIsIDEwKSA9
PSAwKQogCSAgICBHTFJPKGRsX2h3Y2FwX21hc2spID0gX19zdHJ0b3VsX2ludGVybmFsICgmZW52
bGluZVsxMV0sIE5VTEwsCiAJCQkJCQkgICAgICAwLCAwKTsKIAkgIGJyZWFrOwpkaWZmIC1ydU5w
IHN5c2RlcHMvZ2VuZXJpYy91bnNlY3ZhcnMuaCBzeXNkZXBzL2dlbmVyaWMvdW5zZWN2YXJzLmgK
LS0tIHN5c2RlcHMvZ2VuZXJpYy91bnNlY3ZhcnMuaAkyMDA1LTAxLTA2IDIyOjQwOjE5LjAwMDAw
MDAwMCArMDAwMAorKysgc3lzZGVwcy9nZW5lcmljL3Vuc2VjdmFycy5oCTIwMDctMDctMDEgMTY6
MjE6MjEuMDAwMDAwMDAwICswMTAwCkBAIC05LDYgKzksNyBAQAogICAiTERfREVCVUdcMCIJCQkJ
CQkJCSAgICAgIFwKICAgIkxEX0RFQlVHX09VVFBVVFwwIgkJCQkJCQkgICAgICBcCiAgICJMRF9E
WU5BTUlDX1dFQUtcMCIJCQkJCQkJICAgICAgXAorICAiTERfSFdDQVBfTUFTS1wwIiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBcCiAgICJMRF9MSUJSQVJZX1BBVEhcMCIJCQkJCQkJICAg
ICAgXAogICAiTERfT1JJR0lOX1BBVEhcMCIJCQkJCQkJICAgICAgXAogICAiTERfUFJFTE9BRFww
IgkJCQkJCQkgICAgICBcCg==
</data>        

          </attachment>
    </bug>

</bugzilla>