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
c05fd700
Commit
c05fd700
authored
Apr 14, 2022
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-26323 use-after-poison issue of MariaDB server
parent
66832e3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
mysql-test/r/plugin.result
mysql-test/r/plugin.result
+9
-0
mysql-test/t/plugin.test
mysql-test/t/plugin.test
+17
-0
sql/sql_plugin.cc
sql/sql_plugin.cc
+2
-1
No files found.
mysql-test/r/plugin.result
View file @
c05fd700
...
@@ -353,4 +353,13 @@ select * from mysql.plugin WHERE name='unexisting_plugin';
...
@@ -353,4 +353,13 @@ select * from mysql.plugin WHERE name='unexisting_plugin';
name dl
name dl
UNINSTALL PLUGIN unexisting_plugin;
UNINSTALL PLUGIN unexisting_plugin;
ERROR 42000: PLUGIN unexisting_plugin does not exist
ERROR 42000: PLUGIN unexisting_plugin does not exist
#
# MDEV-26323 use-after-poison issue of MariaDB server
#
INSTALL PLUGIN DEALLOCATE SONAME '';
ERROR HY000: Can't open shared library '.so'
INSTALL PLUGIN DEALLOCATE SONAME 'x';
ERROR HY000: Can't open shared library 'x.so'
INSTALL PLUGIN DEALLOCATE SONAME 'xx';
ERROR HY000: Can't open shared library 'xx.so'
# End of 10.2 tests
# End of 10.2 tests
mysql-test/t/plugin.test
View file @
c05fd700
...
@@ -295,4 +295,21 @@ select * from mysql.plugin WHERE name='unexisting_plugin';
...
@@ -295,4 +295,21 @@ select * from mysql.plugin WHERE name='unexisting_plugin';
--
error
ER_SP_DOES_NOT_EXIST
--
error
ER_SP_DOES_NOT_EXIST
UNINSTALL
PLUGIN
unexisting_plugin
;
UNINSTALL
PLUGIN
unexisting_plugin
;
--
echo
#
--
echo
# MDEV-26323 use-after-poison issue of MariaDB server
--
echo
#
--
replace_regex
/
library
'.*[\\/].(dll|so)'
[(]
.*
[)]
/
library
'.so'
/
--
error
ER_CANT_OPEN_LIBRARY
INSTALL
PLUGIN
DEALLOCATE
SONAME
''
;
--
replace_regex
/
library
'.*[\\/]x.(dll|so)'
[(]
.*
[)]
/
library
'x.so'
/
--
error
ER_CANT_OPEN_LIBRARY
INSTALL
PLUGIN
DEALLOCATE
SONAME
'x'
;
--
replace_regex
/
library
'.*[\\/]xx.(dll|so)'
[(]
.*
[)]
/
library
'xx.so'
/
--
error
ER_CANT_OPEN_LIBRARY
INSTALL
PLUGIN
DEALLOCATE
SONAME
'xx'
;
--
echo
# End of 10.2 tests
--
echo
# End of 10.2 tests
sql/sql_plugin.cc
View file @
c05fd700
...
@@ -372,7 +372,8 @@ bool check_valid_path(const char *path, size_t len)
...
@@ -372,7 +372,8 @@ bool check_valid_path(const char *path, size_t len)
static
void
fix_dl_name
(
MEM_ROOT
*
root
,
LEX_STRING
*
dl
)
static
void
fix_dl_name
(
MEM_ROOT
*
root
,
LEX_STRING
*
dl
)
{
{
const
size_t
so_ext_len
=
sizeof
(
SO_EXT
)
-
1
;
const
size_t
so_ext_len
=
sizeof
(
SO_EXT
)
-
1
;
if
(
my_strcasecmp
(
&
my_charset_latin1
,
dl
->
str
+
dl
->
length
-
so_ext_len
,
if
(
dl
->
length
<
so_ext_len
||
my_strcasecmp
(
&
my_charset_latin1
,
dl
->
str
+
dl
->
length
-
so_ext_len
,
SO_EXT
))
SO_EXT
))
{
{
char
*
s
=
(
char
*
)
alloc_root
(
root
,
dl
->
length
+
so_ext_len
+
1
);
char
*
s
=
(
char
*
)
alloc_root
(
root
,
dl
->
length
+
so_ext_len
+
1
);
...
...
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