Commit graph

2085 commits

Author SHA1 Message Date
Sergei Golubchik
82e9f6d948 Merge remote-tracking branch 'mysql/5.5' into 5.5 2015-10-08 22:54:24 +02:00
Sreeharsha Ramanavarapu
6fb2cdbc74 Bug #20777016: DELETE CHECKS PRIVILEGES ON THE WRONG
DATABASE WHEN USING TABLE ALIASES

Issue:
-----
When using table aliases for deleting, MySQL checks
privileges against the current database and not the
privileges on the actual table or database the table
resides.


SOLUTION:
---------
While checking privileges for multi-deletes,
correspondent_table should be used since it points to the
correct table and database.
2015-07-13 07:51:23 +05:30
Arun Kuruvila
c9a38e8698 Merge branch 'mysql-5.1' into mysql-5.5 2015-04-28 14:58:01 +05:30
Arun Kuruvila
fdae90dd11 Bug #20181776 :- ACCESS CONTROL DOESN'T MATCH MOST SPECIFIC
HOST WHEN IT CONTAINS WILDCARD

Description :- Incorrect access privileges are provided to a
user due to wrong sorting of users when wildcard characters
is present in the hostname.

Analysis :- Function "get_sorts()" is used to sort the
strings of user name, hostname, database name. It is used
to arrange the users in the access privilege matching order.
When a user connects, it checks in the sorted user access
privilege list and finds a corresponding matching entry for
the user. Algorithm used in "get_sort()" sorts the strings
inappropriately. As a result, when a user connects to the
server, it is mapped to incorrect user access privileges.
Algorithm used in "get_sort()" counts the number of
characters before the first occurence of any one of the
wildcard characters (single-wildcard character '_' or
multi-wildcard character '%') and sorts in that order.
As a result of inconnect sorting it treats hostname "%" and
"%.mysql.com" as equally-specific values and therefore
the order is indeterminate.

Fix:- The "get_sort()" algorithm has been modified to treat
"%" seperately. Now "get_sort()" returns a number which, if
sorted in descending order, puts strings in the following
order:-
* strings with no wildcards
* strings containg wildcards and non-wildcard characters
* single muilt-wildcard character('%')
* empty string.
2015-04-28 14:56:55 +05:30
V S Murthy Sidagam
7797ef4dec Merge branch 'mysql-5.1' into mysql-5.5 2015-04-27 14:46:40 +05:30
V S Murthy Sidagam
c655515d1b Bug #20683237 BACKPORT 19817663 TO 5.1 and 5.5
Restrict when user table hashes can be viewed. Require SUPER privileges.
2015-04-27 14:33:25 +05:30
Sergey Vojtovich
d1e46a50bc MDEV-6749 - Deadlock between GRANT/REVOKE, SELECT FROM I_S.COLUMNS,
SET slow_query_log and failed connection attempt

A very subtle though valid deadlock. Deadlock chain:
wrlock(LOCK_grant)    -> lock(acl_cache->lock) GRANT/REVOKE CREATE/DROP USER
lock(LOCK_open)       -> rdlock(LOCK_grant)    SELECT * FROM I_S.COLUMNS
wrlock(LOCK_logger)   -> lock(LOCK_open)       SET @@global.slow_query_log='ON'
lock(acl_cache->lock) -> rdlock(LOCK_logger)   Failed connection

Fixed by removing relationship between acl_cache->lock and LOCK_logger
during failed connection attempt.
2014-09-18 19:45:06 +04:00
Venkata Sidagam
3bba29a397 Bug #17357528 BACKPORT BUG#16513435 TO 5.5 AND 5.6
Description: Backporting BUG#16513435 to 5.5 and 5.6
This is a fix for REMOTE PREAUTH USER ENUMERATION FLAW bug
2014-06-30 19:24:25 +05:30
Sergei Golubchik
5d8c15228e 5.3-merge 2014-03-16 19:21:37 +01:00
Sergei Golubchik
a0ea960c3e 5.2 merge 2014-03-13 18:36:52 +01:00
Sergei Golubchik
5616bd5597 unix_socket bypasses make_if_fail by not doing any network reads 2014-03-13 16:35:14 +01:00
Sergei Golubchik
84651126c0 MySQL-5.5.36 merge
(without few incorrect bugfixes and with 1250 files where only a copyright year was changed)
2014-02-17 11:00:51 +01:00
Murthy Narkedimilli
c92223e198 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Murthy Narkedimilli
496abd0814 Updated/added copyright headers 2014-01-06 10:52:35 +05:30
Venkata Sidagam
e84d48742e Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE
Merging from mysql-5.1 to mysql-5.5
2013-10-16 14:16:32 +05:30
Venkata Sidagam
f8e2765582 Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE
Merging from mysql-5.1 to mysql-5.5
2013-10-16 14:16:32 +05:30
Venkata Sidagam
9fc5122471 Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE
Description: Fix for bug CVE-2012-5611 (bug 67685) is 
incomplete. The ACL_KEY_LENGTH-sized buffers in acl_get() and 
check_grant_db() can be overflown by up to two bytes. That's 
probably not enough to do anything more serious than crashing 
mysqld.
Analysis: In acl_get() when "copy_length" is calculated it 
just adding the variable lengths. But when we are using them 
with strmov() we are adding +1 to each. This will lead to a 
three byte buffer overflow (i.e two +1's at strmov() and one 
byte for the null added by strmov() function). Similarly it 
happens for check_grant_db() function as well.
Fix: We need to add "+2" to "copy_length" in acl_get() 
and "+1" to "copy_length" in check_grant_db().
2013-10-16 14:14:44 +05:30
Venkata Sidagam
de0e8a02d1 Bug#16900358 FIX FOR CVE-2012-5611 IS INCOMPLETE
Description: Fix for bug CVE-2012-5611 (bug 67685) is 
incomplete. The ACL_KEY_LENGTH-sized buffers in acl_get() and 
check_grant_db() can be overflown by up to two bytes. That's 
probably not enough to do anything more serious than crashing 
mysqld.
Analysis: In acl_get() when "copy_length" is calculated it 
just adding the variable lengths. But when we are using them 
with strmov() we are adding +1 to each. This will lead to a 
three byte buffer overflow (i.e two +1's at strmov() and one 
byte for the null added by strmov() function). Similarly it 
happens for check_grant_db() function as well.
Fix: We need to add "+2" to "copy_length" in acl_get() 
and "+1" to "copy_length" in check_grant_db().
2013-10-16 14:14:44 +05:30
Sergei Golubchik
d126993404 MDEV-4951 drop user leaves privileges
It's safe to delete from HASH when traversing it *backwards*, but not *forwards*.
2013-08-28 07:49:53 +02:00
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Ashish Agarwal
e879caf845 WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7
Backporting wl6715 to mysql-5.5
2013-07-02 11:58:39 +05:30
Ashish Agarwal
f5b5e6b951 WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7
Backporting wl6715 to mysql-5.5
2013-07-02 11:58:39 +05:30
Sergei Golubchik
d7a6c801ac 5.3 merge.
change maria.distinct to use a function that doesn't require ssl-enabled  builds
2013-05-20 12:36:30 +02:00
Sergei Golubchik
639a766096 5.2 merge 2013-05-20 11:13:07 +02:00
Sergei Golubchik
66cc619609 MDEV-4514 After increasing user name length mysql.db is reported broken and event scheduler does not start 2013-05-13 16:11:39 +02:00
Sergei Golubchik
4a0f2563d3 MDEV-4462 mysqld gets SIGFPE when mysql.user table is empty
avoid divison by zero
2013-05-08 14:32:32 +02:00
Sergei Golubchik
84ce6832e6 MDEV-4332 Increase username length from 16 characters 2013-04-18 22:17:29 +02:00
Sergei Golubchik
07315d3603 strmake_buf(X,Y) helper, equivalent to strmake(X,Y,sizeof(X)-1)
with a bit of lame protection against abuse.
2013-04-17 19:42:34 +02:00
Sergei Golubchik
102a7a2a76 MDEV-4307 Support at least 48 utf8 characters in username in server and PAM
Extend plugin auth api to support up to 512 bytes in the user names.
Use the API versioning to support old auth plugins too!
2013-03-26 19:17:26 +01:00
Murthy Narkedimilli
8afe262ae5 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Murthy Narkedimilli
d978016d93 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Murthy Narkedimilli
d20a70fb55 Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
Murthy Narkedimilli
fe85f54640 Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
Harin Vadodaria
ca2708c061 Bug#16372927: STACK OVERFLOW WITH LONG DATABASE NAME IN
GRANT STATEMENT

Description: Merge from 5.1.
2013-02-26 21:29:43 +05:30
Harin Vadodaria
1f3044f3eb Bug#16372927: STACK OVERFLOW WITH LONG DATABASE NAME IN
GRANT STATEMENT

Description: Merge from 5.1.
2013-02-26 21:29:43 +05:30
Harin Vadodaria
f032a9acf7 Bug#16372927: STACK OVERFLOW WITH LONG DATABASE NAME IN
GRANT STATEMENT

Description: A missing length check causes problem while
             copying source to destination when
             lower_case_table_names is set to a value
             other than 0. This patch fixes the issue
             by ensuring that requried bound check is
             performed.
2013-02-26 21:23:06 +05:30
Harin Vadodaria
fd4ea8b094 Bug#16372927: STACK OVERFLOW WITH LONG DATABASE NAME IN
GRANT STATEMENT

Description: A missing length check causes problem while
             copying source to destination when
             lower_case_table_names is set to a value
             other than 0. This patch fixes the issue
             by ensuring that requried bound check is
             performed.
2013-02-26 21:23:06 +05:30
Murthy Narkedimilli
69d8812a61 Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Murthy Narkedimilli
053d7e775c Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Sergei Golubchik
672b293860 5.3 merge
client/mysqltest.cc:
  make --error to work for --change_user errors
2013-01-25 11:24:42 +01:00
Sergei Golubchik
de10e21411 5.2 merge 2013-01-25 10:20:45 +01:00
Sergei Golubchik
fa7d0c4fdf MDEV-3909 remote user enumeration
instead of returning Access denied on the incorrect user name,
emulate the complete failed logic procedure, possibly with
the change plugin packet.
2013-01-25 09:41:26 +01:00
Sergei Golubchik
82c022f2d5 report "using password: YES/NO" correctly for the COM_CHANGE_USER failures 2013-01-25 00:20:53 +01:00
Sergei Golubchik
d3935adf7a mysql-5.5.29 merge 2013-01-15 19:13:32 +01:00
Sergei Golubchik
aca8e7ed6b 5.3 merge 2013-01-15 19:07:46 +01:00
Sergei Golubchik
4f67a14700 5.2->5.3 merge 2013-01-10 15:40:21 +01:00
Sergei Golubchik
bd87fed1dc 5.1 merge 2013-01-10 13:54:04 +01:00
Sergei Golubchik
2e11ca36f2 mysql-5.1.67 merge 2013-01-09 23:51:51 +01:00
Harin Vadodaria
d8876ff2fb Bug#15912213: BUFFER OVERFLOW IN ACL_GET()
Description: A very large database name causes buffer
             overflow in functions acl_get() and
             check_grant_db() in sql_acl.cc. It happens
             due to an unguarded string copy operation.
             This puts required sanity checks before
             copying db string to destination buffer.
2012-12-06 17:02:09 +05:30
Harin Vadodaria
aec9ca5da4 Bug#15912213: BUFFER OVERFLOW IN ACL_GET()
Description: A very large database name causes buffer
             overflow in functions acl_get() and
             check_grant_db() in sql_acl.cc. It happens
             due to an unguarded string copy operation.
             This puts required sanity checks before
             copying db string to destination buffer.
2012-12-06 16:53:02 +05:30