Bug 172775 - Replication seems to corrupt hosts cache
Replication seems to corrupt hosts cache
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
4
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
http://bugs.mysql.com/bug.php?id=13659
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-09 11:05 EST by Andrew Stribblehill
Modified: 2013-07-02 23:07 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-09 13:30:21 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andrew Stribblehill 2005-11-09 11:05:41 EST
Description of problem:
I'm using replication and the MySQL servers are occasionally caching the wrong
values for hostnames (see URL). It appears that all the users who reported the
bug to MySQL are Red Hat users.

Version-Release number of selected component (if applicable):
mysql-server-4.1.14-1.FC4.1

How reproducible:
sometimes

Steps to Reproduce:
1.Set up replication
2.access master from many hosts (sorry this is vague)
3.watch for inconsistencies: make a connection from foo.example.com and do
SELECT USER();
  
Actual results:
notice that it says user@bar.example.com

Expected results:
user@foo.example.com

Additional info:

Problem goes away when we disable the MySQL host cache.

$ grep hosts /etc/nsswitch.conf
hosts:   dns nis [NOTFOUND=return] files

Nothing freaky in /etc/hosts

$ ypcat hosts
127.0.0.1       localhost loghost
129.234.4.13    timehost
129.234.4.78    nsrhost
127.0.0.1       localhost loghost

The DNS entries don't change (!)

getent hosts foo.example.com and its IP works fine.

Running NSCD but I've had this problem with NSCD turned off too.

ObSecurity:
I assert that this is a possible security problem because many sites use
host-based MySQL access control rules. It certainly caused me a denial of
service when the replication master had the wrong value for the replication slave.
Comment 1 Tom Lane 2005-11-09 11:26:35 EST
You should file this with www.mysql.com; it's unlikely that I'd be able to find
the problem.  Nor do I see any reason to think it's a Red Hat rather than MySQL
bug.
Comment 2 Andrew Stribblehill 2005-11-09 11:55:28 EST
I'm sorry, I was sure I'd filled in the URL field that showed the MySQL bug
(http://bugs.mysql.com/bug.php?id=13659). The reason I've filed it with Red Hat
as well is:

  * each of the reporters has been running a Red Hat distribution of some form
  * MySQL AB don't think it's their bug (though they haven't told us why yet,
admittedly).

<sigh> I guess I'll go and chase MySQL a bit more...
Comment 3 Tom Lane 2005-11-09 13:30:21 EST
Ah, I missed the link to an upstream bug report.  I see that the latest comment
there acknowledges that it probably is a MySQL bug.  I'm going to close this
entry as being filed upstream; but feel free to reopen this report if it does
turn out to be Red Hat specific, or if MySQL provide a fix in a future update.

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