summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-09-14 19:15:26 +0200
committerSergei Golubchik <serg@mariadb.org>2022-09-14 19:15:44 +0200
commitbeffef9f0019d4519447339564d2cf18bebb8401 (patch)
tree409e00ef4b23859d3154eb08f52f60f2acdba5fe
parentb7928f756618fa6fb6fc52c0b4e3214f7a061d21 (diff)
downloadmariadb-git-beffef9f0019d4519447339564d2cf18bebb8401.tar.gz
MDEV-22647 Assertion `!check_audit_mask(mysql_global_audit_mask, event_class_mask)'
check_audit_mask(mysql_global_audit_mask, event_class_mask) is tested in mysql_audit_general_log() and then assert in mysql_audit_acquire_plugins() verifies that the condition still holds. But this code path is not protected by LOCK_audit_mask, so mysql_global_audit_mask can change its value between the if() and the assert. That is, the assert is invalid and will fire if the audit plugin is unloaded concurrently with mysql_audit_general_log(). Nothing bad will happen in this case though, we'll just do a useless loop over all remaining installed audit plugins. That is, the fix is simply to remove the assert.
-rw-r--r--sql/sql_audit.cc2
1 files changed, 0 insertions, 2 deletions
diff --git a/sql/sql_audit.cc b/sql/sql_audit.cc
index ed175ae4865..14e876ef749 100644
--- a/sql/sql_audit.cc
+++ b/sql/sql_audit.cc
@@ -113,8 +113,6 @@ void mysql_audit_acquire_plugins(THD *thd, ulong *event_class_mask)
{
DBUG_ENTER("mysql_audit_acquire_plugins");
DBUG_ASSERT(thd);
- DBUG_ASSERT(!check_audit_mask(mysql_global_audit_mask, event_class_mask));
-
if (check_audit_mask(thd->audit_class_mask, event_class_mask))
{
plugin_foreach(thd, acquire_plugins, MYSQL_AUDIT_PLUGIN, event_class_mask);