Description of problem: Memory Dos in mysql exploitable by anyone that can read two tables with sufficient rows. Version-Release number of selected component (if applicable): mysql-server-5.0.77-3 How reproducible: Create database and two tables: CREATE DATABASE bugtest; USE bugtest; CREATE TABLE `A` ( `id` int(11) NOT NULL default '0', `val` int(11) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; CREATE TABLE `B` ( `id` int(11) NOT NULL default '0', `val` int(11) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Populate: for x in `seq 1 10000`; do mysql -e "insert into A values ($x,$x); insert into B values ($x,$x);" bugtest; done Query: SELECT *,count(*) count FROM A,B WHERE B.id IN( SELECT DISTINCT id FROM A WHERE A.id=B.id) GROUP BY A.id ORDER BY count DESC; Actual results: Sit back and watch memory usage climb till death. Expected results: Memory usage should not uncontrollably climb. Additional info: Reported upstream as http://bugs.mysql.com/bug.php?id=47980 reported as not affecting 5.0.86
Found original mysql report: http://bugs.mysql.com/bug.php?id=42037
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
Still broken in mysql-server-5.0.77-4.el5_5.4.x86_64
Upstream commit: http://lists.mysql.com/commits/64898 Actual uppstream patch appears to be here: http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.0/revision/2710.31.5
Created attachment 469431 [details] Proposed patch Adapted from upstream http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.0/revision/2710.31.5.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0121.html