<?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>122399</bug_id>
          
          <creation_ts>2006-02-10 10:29 0000</creation_ts>
          <short_desc>games-misc/bsd-games: tetris-bsd buffer overflows</short_desc>
          <delta_ts>2006-03-29 11:22: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>B2 [glsa] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>taviso@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>games@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2006-02-10 10:29:12 0000</bug_when>
            <thetext>The checkscores() function in scores.c reads in the data from the /var/games/tetris-bsd.scores file without validation. Because gentoo doesnt follow the standard setgid games policy, any user in group games can write whatever data they like to the score file.

The players name is printed into a buffer using sprintf without validation, causing a classic stack overflow. On another occasion, the level is read from the file without validation, which is then used as an offset into an integer stack array and written to. While what&apos;s written cant be controlled, this could be enough to modify an ret addr enough to execute arbitrary code read from the score file.

This is not a bug in bsd-games, only gentoo is vulnerable because of our group games policy.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2006-02-10 10:29:36 0000</bug_when>
            <thetext>Created an attachment (id=79447)
sec patch

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2006-02-11 14:00:26 0000</bug_when>
            <thetext>Games team, please advise.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2006-02-21 09:49:33 0000</bug_when>
            <thetext>Late.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2006-03-17 06:37:33 0000</bug_when>
            <thetext>games team give permission to mask until a fix is available</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-03-17 11:06:13 0000</bug_when>
            <thetext>New ebuild, 2.17-r1 has been added and is stable on x86.  Other arches will need to test and keyword as appropriate.  Sorry for the delay, I&apos;m just now getting back into the swing of bug-fixing.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2006-03-19 13:06:52 0000</bug_when>
            <thetext>ppc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>weeve@gentoo.org</who>
            <bug_when>2006-03-19 19:14:43 0000</bug_when>
            <thetext>SPARC&apos;d</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>geekypenguin@gmail.com</who>
            <bug_when>2006-03-29 11:02:13 0000</bug_when>
            <thetext>AMD64 stable.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2006-03-29 11:22:41 0000</bug_when>
            <thetext>GLSA 200603-26

Thanks everybody.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>79447</attachid>
            <date>2006-02-10 10:29 0000</date>
            <desc>sec patch</desc>
            <filename>tetris-sec.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGJzZC1nYW1lcy0yLjEzL3RldHJpcy9zY29yZXMuYy5vcmlnCTIwMDYtMDItMTAgMTg6MTE6
NDEuNzA0NzcwMjgwICswMDAwCisrK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