Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fab383aa
Commit
fab383aa
authored
Apr 30, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use after free in authentication
parent
a52c46e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
2 deletions
+20
-2
mysql-test/r/connect_debug.result
mysql-test/r/connect_debug.result
+5
-0
mysql-test/t/connect_debug.test
mysql-test/t/connect_debug.test
+12
-0
sql-common/client.c
sql-common/client.c
+2
-2
sql/sql_acl.cc
sql/sql_acl.cc
+1
-0
No files found.
mysql-test/r/connect_debug.result
0 → 100644
View file @
fab383aa
set @old_dbug=@@global.debug_dbug;
set global debug_dbug='+d,auth_disconnect';
create user 'bad' identified by 'worse';
set global debug_dbug=@old_dbug;
drop user bad;
mysql-test/t/connect_debug.test
0 → 100644
View file @
fab383aa
source
include
/
have_debug
.
inc
;
set
@
old_dbug
=@@
global
.
debug_dbug
;
#
# use after free if need plugin change and auth aborted
#
set
global
debug_dbug
=
'+d,auth_disconnect'
;
create
user
'bad'
identified
by
'worse'
;
--
error
1
--
exec
$MYSQL
--
default
-
auth
=
mysql_old_password
--
user
=
bad
--
password
=
worse
set
global
debug_dbug
=@
old_dbug
;
drop
user
bad
;
sql-common/client.c
View file @
fab383aa
...
...
@@ -2742,7 +2742,7 @@ static int client_mpvio_read_packet(struct st_plugin_vio *mpv, uchar **buf)
*
buf
=
mysql
->
net
.
read_pos
;
/* was it a request to change plugins ? */
if
(
**
buf
==
254
)
if
(
pkt_len
==
packet_error
||
**
buf
==
254
)
return
(
int
)
packet_error
;
/* if yes, this plugin shan't continue */
/*
...
...
@@ -2927,7 +2927,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
compile_time_assert
(
CR_OK
==
-
1
);
compile_time_assert
(
CR_ERROR
==
0
);
if
(
res
>
CR_OK
&&
mysql
->
net
.
read_pos
[
0
]
!=
254
)
if
(
res
>
CR_OK
&&
(
mysql
->
net
.
last_errno
||
mysql
->
net
.
read_pos
[
0
]
!=
254
)
)
{
/*
the plugin returned an error. write it down in mysql,
...
...
sql/sql_acl.cc
View file @
fab383aa
...
...
@@ -8217,6 +8217,7 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
const
char
*
client_auth_plugin
=
((
st_mysql_auth
*
)
(
plugin_decl
(
mpvio
->
plugin
)
->
info
))
->
client_auth_plugin
;
DBUG_EXECUTE_IF
(
"auth_disconnect"
,
{
vio_close
(
net
->
vio
);
DBUG_RETURN
(
1
);
});
DBUG_ASSERT
(
client_auth_plugin
);
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment