mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#51377 Crash in information_schema / processlist on concurrent DDL workload
the fill_schema_processlist function accesses THD::query() without proper protection
so the parallel thread killing can lead to access to the freed meemory.
per-file comments:
sql/sql_load.cc
Bug#51377 Crash in information_schema / processlist on concurrent DDL workload
the THD::set_query_inner() call needs to be protected.
But here we don't need to change the original thd->query() at all.
sql/sql_show.cc
Bug#51377 Crash in information_schema / processlist on concurrent DDL workload
protect the THD::query() access with the THD::LOCK_thd_data mutex.
This commit is contained in:
@@ -1991,6 +1991,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
|
||||
pthread_mutex_unlock(&mysys_var->mutex);
|
||||
|
||||
/* INFO */
|
||||
/* Lock THD mutex that protects its data when looking at it. */
|
||||
pthread_mutex_lock(&tmp->LOCK_thd_data);
|
||||
if (tmp->query())
|
||||
{
|
||||
table->field[7]->store(tmp->query(),
|
||||
@@ -1998,6 +2000,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
|
||||
tmp->query_length()), cs);
|
||||
table->field[7]->set_notnull();
|
||||
}
|
||||
pthread_mutex_unlock(&tmp->LOCK_thd_data);
|
||||
|
||||
if (schema_table_store_record(thd, table))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user