Bug 528512 - MySQL memory DoS
Summary: MySQL memory DoS
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mysql
Version: 5.4
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Tom Lane
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 692953
TreeView+ depends on / blocked
 
Reported: 2009-10-12 14:49 UTC by Kal McFate
Modified: 2018-11-14 14:51 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-08 04:53:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (5.60 KB, patch)
2010-12-17 19:02 UTC, Bryan Mason
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0121 0 normal SHIPPED_LIVE Low: mysql security and bug fix update 2013-01-08 09:10:21 UTC

Description Kal McFate 2009-10-12 14:49:26 UTC
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

Comment 1 Kal McFate 2009-10-12 16:48:15 UTC
Found original mysql report: http://bugs.mysql.com/bug.php?id=42037

Comment 3 RHEL Program Management 2010-08-09 19:04:01 UTC
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.

Comment 4 Kal McFate 2010-12-03 14:47:24 UTC
Still broken in mysql-server-5.0.77-4.el5_5.4.x86_64

Comment 5 Bryan Mason 2010-12-08 00:45:45 UTC
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

Comment 6 Bryan Mason 2010-12-17 19:02:26 UTC
Created attachment 469431 [details]
Proposed patch

Adapted from upstream http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.0/revision/2710.31.5.

Comment 29 errata-xmlrpc 2013-01-08 04:53:41 UTC
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


Note You need to log in before you can comment on or make changes to this bug.