openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/
Other
848 stars 214 forks source link

Fuzzer: Virtuoso 7.2.11 crashed at `sqlg_group_node` #1211

Closed fuboat closed 7 months ago

fuboat commented 7 months ago

The PoC is generated by my DBMS fuzzer. It can also be reproduced in the beta docker image.

CREATE TABLE v0 ( v3 CHAR(1) NULL , v2 CHAR(1) NULL , v1 INT NULL ) ;
 SELECT v3 ( 'arteriole' ) FROM v0 WHERE v1 = '313233' OR v3 = 'xyzz ' ORDER BY count ( * ) , v2 ;

backtrace:

#0 0x7464e7 (sqlg_group_node+0x487)
#1 0x748e26 (sqlg_dt_query_1+0x906)
#2 0x74a9e7 (sqlg_top_1+0x107)
#3 0x70ffb4 (sqlo_top_select+0x164)
#4 0x6b9b6f (sql_stmt_comp+0x8bf)
#5 0x6bc9d2 (sql_compile_1+0x1a62)
#6 0x7cba60 (stmt_set_query+0x340)
#7 0x7cd952 (sf_sql_execute+0x922)
#8 0x7cecde (sf_sql_execute_w+0x17e)
#9 0x7d799d (sf_sql_execute_wrapper+0x3d)
#10 0xe214bc (future_wrapper+0x3fc)
#11 0xe28dbe (_thread_boot+0x11e)
#12 0x7f912251f609 (start_thread+0xd9)
#13 0x7f91222ef133 (clone+0x43)

ways to reproduce (write poc to the file /tmp/test.sql first):

# remove the old one
docker container rm virtdb_test -f
# start virtuoso through docker
docker run --name virtdb_test -itd --env DBA_PASSWORD=dba  pkleef/virtuoso-opensource-7
# wait the server starting
sleep 10
# check whether the simple query works
echo "SELECT 1;" | docker exec -i virtdb_test isql 1111 dba
# run the poc
cat /tmp/test.sql | docker exec -i virtdb_test isql 1111 dba
pkleef commented 7 months ago

Fixed by recent patches on the develop/7 branch.