Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5.9, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
Ubuntu 18.04
MariaDB 10.5.9
Description
I used my fuzzing tool to test Mariadb , and found a bug that can result in an abortion.
Mariadb installation:
1) cd mariadb-10.5.9
2) mkdir build; cd build
3) cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_DEBUG=ON ../
4) make -j8 && sudo make install
How to Repeat:
export ASAN_OPTIONS=detect_leaks=0
/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysql -uroot -p123456(your password)
MariaDB> drop database if exists test_db;
MariaDB> create database test_db;
MariaDB> source fuzz.sql;
I have simplified the content of fuzz.sql, and I hope fuzz.sql can help you reproduce the bug and fix it. In addition, I attach the abortion report (which has its stack trace).
Attachments
Issue Links
- relates to
-
MDEV-14791 Crash with order by expression containing window functions
-
- Closed
-
-
MDEV-28094 Window function in expression in ORDER BY
-
- Closed
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Description |
I used my fuzzing tool to test Mariadb , and found a bug that can result in an abortion.
Mariadb installation: 1) cd mariadb-10.5.9 2) mkdir build; cd build 3) cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_DEBUG=ON ../ 4) make -j8 && sudo make install How to Repeat: export ASAN_OPTIONS=detect_leaks=0 /usr/local/mysql/bin/mysqld_safe & /usr/local/mysql/bin/mysql -uroot -p123456(your password) MariaDB> drop database if exists test_db; MariaDB> create database test_db; MariaDB> source fuzz.sql; I have simplified the content of fuzz.sql, and I hope fuzz.sql can help you reproduce the bug and fix it. In addition, I attach the abortion report (which has its stack trace). |
I used my fuzzing tool to test Mariadb , and found a bug that can result in an abortion.
*Mariadb installation:* 1) cd mariadb-10.5.9 2) mkdir build; cd build 3) cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_DEBUG=ON ../ 4) make -j8 && sudo make install *How to Repeat:* export ASAN_OPTIONS=detect_leaks=0 /usr/local/mysql/bin/mysqld_safe & /usr/local/mysql/bin/mysql -uroot -p123456(your password) MariaDB> drop database if exists test_db; MariaDB> create database test_db; MariaDB> source fuzz.sql; I have simplified the content of fuzz.sql, and I hope fuzz.sql can help you reproduce the bug and fix it. In addition, I attach the abortion report (which has its stack trace). |
Affects Version/s | 10.2 [ 14601 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Component/s | Optimizer - Window functions [ 13502 ] |
Link |
This issue relates to |
Assignee | Sergei Petrunia [ psergey ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Epic/Theme | server |
Component/s | Query Cache [ 10120 ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Summary | Bug report: abortion in sql/sql_yacc.yy:0 | Crash with window function in left expr of IN subquery |
Assignee | Sergei Petrunia [ psergey ] | Oleksandr Byelkin [ sanja ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Sergei Petrunia [ psergey ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.6.2 [ 25800 ] | |
Fix Version/s | 10.2.39 [ 25731 ] | |
Fix Version/s | 10.3.30 [ 25732 ] | |
Fix Version/s | 10.4.20 [ 25733 ] | |
Fix Version/s | 10.5.11 [ 25734 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Labels | crash | crash fuzzer |
Fix Version/s | 10.2.40 [ 26027 ] | |
Fix Version/s | 10.3.31 [ 26028 ] | |
Fix Version/s | 10.4.21 [ 26030 ] | |
Fix Version/s | 10.5.12 [ 26025 ] | |
Fix Version/s | 10.6.3 [ 25904 ] | |
Fix Version/s | 10.2.39 [ 25731 ] | |
Fix Version/s | 10.3.30 [ 25732 ] | |
Fix Version/s | 10.4.20 [ 25733 ] | |
Fix Version/s | 10.5.11 [ 25734 ] | |
Fix Version/s | 10.6.2 [ 25800 ] |
Workflow | MariaDB v3 [ 121707 ] | MariaDB v4 [ 159254 ] |
Remote Link | This issue links to "CVE-2021-46658 (Web Link)" [ 33013 ] |
Link |
This issue relates to |
Thank you very much! I repeated on 10.2-10.5:
10.2 d0785f773188b5f0eebb313
#3 <signal handler called>
#4 0x0000559ff0189f92 in set_field_to_null_with_conversions (field=0x0, no_conversions=true) at /10.2/src/sql/field_conv.cc:204
#5 0x0000559ff01ba6da in Item::save_in_field (this=0x7fbeac012c20, field=0x0, no_conversions=true) at /10.2/src/sql/item.cc:6430
#6 0x0000559ff00e4b82 in save_window_function_values (window_functions=..., tbl=0x7fbeac191a08, rowid_buf=0x7fbeac134cf0 "p\333\f\254\276\177") at /10.2/src/sql/sql_window.cc:2534
#7 0x0000559ff00e5047 in compute_window_func (thd=0x7fbeac000d90, window_functions=..., cursor_managers=..., tbl=0x7fbeac191a08, filesort_result=0x7fbeac193280) at /10.2/src/sql/sql_window.cc:2679
#8 0x0000559ff00e5424 in Window_func_runner::exec (this=0x7fbeac0a1718, thd=0x7fbeac000d90, tbl=0x7fbeac191a08, filesort_result=0x7fbeac193280) at /10.2/src/sql/sql_window.cc:2782
#9 0x0000559ff00e554a in Window_funcs_sort::exec (this=0x7fbeac0a1710, join=0x7fbeac0149b0, keep_filesort_result=true) at /10.2/src/sql/sql_window.cc:2810
#10 0x0000559ff00e5a44 in Window_funcs_computation::exec (this=0x7fbeac0a16f0, join=0x7fbeac0149b0, keep_last_filesort_result=true) at /10.2/src/sql/sql_window.cc:2937
#11 0x0000559feff96992 in AGGR_OP::end_send (this=0x7fbeac0a15c0) at /10.2/src/sql/sql_select.cc:26865
#12 0x0000559feff813e7 in sub_select_postjoin_aggr (join=0x7fbeac0149b0, join_tab=0x7fbeac0168f0, end_of_records=true) at /10.2/src/sql/sql_select.cc:18589
#13 0x0000559feff8171b in sub_select (join=0x7fbeac0149b0, join_tab=0x7fbeac016540, end_of_records=true) at /10.2/src/sql/sql_select.cc:18825
#14 0x0000559feff80eff in do_select (join=0x7fbeac0149b0, procedure=0x0) at /10.2/src/sql/sql_select.cc:18420
#15 0x0000559feff5aa87 in JOIN::exec_inner (this=0x7fbeac0149b0) at /10.2/src/sql/sql_select.cc:3651
#16 0x0000559feff59f2e in JOIN::exec (this=0x7fbeac0149b0) at /10.2/src/sql/sql_select.cc:3446
#17 0x0000559feff5b108 in mysql_select (thd=0x7fbeac000d90, tables=0x7fbeac014278, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fbeac014990, unit=0x7fbeac004988, select_lex=0x7fbeac0050c8) at /10.2/src/sql/sql_select.cc:3849
#18 0x0000559feff4f25c in handle_select (thd=0x7fbeac000d90, lex=0x7fbeac0048c8, result=0x7fbeac014990, setup_tables_done_option=0) at /10.2/src/sql/sql_select.cc:361
#19 0x0000559feff19771 in execute_sqlcom_select (thd=0x7fbeac000d90, all_tables=0x7fbeac014278) at /10.2/src/sql/sql_parse.cc:6274
#20 0x0000559feff102e5 in mysql_execute_command (thd=0x7fbeac000d90) at /10.2/src/sql/sql_parse.cc:3585
#21 0x0000559feff1d52c in mysql_parse (thd=0x7fbeac000d90, rawbuf=0x7fbeac0126f8 "SELECT lag(i) over (ORDER BY 1) IN ( SELECT 1 FROM t1 a) FROM t1", length=64, parser_state=0x7fbf02903570, is_com_multi=false, is_next_command=false) at /10.2/src/sql/sql_parse.cc:7796
#22 0x0000559feff0b756 in dispatch_command (command=COM_QUERY, thd=0x7fbeac000d90, packet=0x7fbeac008b51 "", packet_length=64, is_com_multi=false, is_next_command=false) at /10.2/src/sql/sql_parse.cc:1827
#23 0x0000559feff0a251 in do_command (thd=0x7fbeac000d90) at /10.2/src/sql/sql_parse.cc:1381
#24 0x0000559ff006588e in do_handle_one_connection (connect=0x559ff22a0a40) at /10.2/src/sql/sql_connect.cc:1336
#25 0x0000559ff00655f3 in handle_one_connection (arg=0x559ff22a0a40) at /10.2/src/sql/sql_connect.cc:1241
#26 0x0000559ff08911a8 in pfs_spawn_thread (arg=0x559ff2283e40) at /10.2/src/storage/perfschema/pfs.cc:1869
#27 0x00007fbf08b08609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#28 0x00007fbf086e2293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95