-
Marek Szymczak authored
Issue: ====== Every audit pluign defines mask of events, which are handled by the plugin. Sum of all event mask is maintained in the global mysql_global_audit_mask array variable. If one plugin is interested into all general events, its plugin mask is [ 0xf, 0x0, ... ]. A plugin that is interested into all connection events, its plugin mask is [ 0x0, 0xf, 0x0, ... ]. A global mysql_global_audit_mask variable holds sum of all values: [ 0xf, 0xf, 0x0, ... ] Audit plugins are loaded into a client session on demand. If a server is about to signal specific event, plugin acquisition is performed, which loads audit plugins that match requested mask and plugin mask. Acquired plugin mask is copied into a session's audit_class_mask, which is invalid and lead to a situation that prevents other audit plugin to load, because audit_class_mask already contains that events: Plugin 'A' is interested into general events [ 0xf, 0x0, ... ] Plugin 'B' is interested into general and connection events [ 0xf, 0xf, 0x0, ... ] Connection events are generated as first events, so plugins that handle connection events are loaded first (Plugin 'B'). Session mask will contain following mask, after the plugin is loaded: audit_class_mask: [ 0xf, 0xf, 0x0, ... ] When general event is about to be generated, audit_class_mask is compared against mysql_globa_audit_mask array. Because they are the same, no action is performed, which is obviously wrong, because Plugin 'A' has not been acquired by the session. Fix: ==== During acquisition of the plugins that handle specific events, audit_class_mask contains events of the plugin currently loaded, but excluding bits of audit plugins not loaded. This guarantees that other audit plugis could be loaded later on demand. Acquisition of the plugins that handle connection events, will result in acquisition of the Plugin 'B'. audit_class_mask will contain [ 0x0, 0xf, 0x0, ... ], which represents acquired plugins, excluding plugins that have not been acquired. Generation of the general event will result is reacquisition of the plugins and the audit_class_maks will contain [ 0xf, 0xf, 0x0, ... ] eventually. Reviewers: ========== Georgi Kodinov <georgi.kodinov@oracle.com> Harin Vadodaria <harin.vadodaria@oracle.com>
Marek Szymczak authoredIssue: ====== Every audit pluign defines mask of events, which are handled by the plugin. Sum of all event mask is maintained in the global mysql_global_audit_mask array variable. If one plugin is interested into all general events, its plugin mask is [ 0xf, 0x0, ... ]. A plugin that is interested into all connection events, its plugin mask is [ 0x0, 0xf, 0x0, ... ]. A global mysql_global_audit_mask variable holds sum of all values: [ 0xf, 0xf, 0x0, ... ] Audit plugins are loaded into a client session on demand. If a server is about to signal specific event, plugin acquisition is performed, which loads audit plugins that match requested mask and plugin mask. Acquired plugin mask is copied into a session's audit_class_mask, which is invalid and lead to a situation that prevents other audit plugin to load, because audit_class_mask already contains that events: Plugin 'A' is interested into general events [ 0xf, 0x0, ... ] Plugin 'B' is interested into general and connection events [ 0xf, 0xf, 0x0, ... ] Connection events are generated as first events, so plugins that handle connection events are loaded first (Plugin 'B'). Session mask will contain following mask, after the plugin is loaded: audit_class_mask: [ 0xf, 0xf, 0x0, ... ] When general event is about to be generated, audit_class_mask is compared against mysql_globa_audit_mask array. Because they are the same, no action is performed, which is obviously wrong, because Plugin 'A' has not been acquired by the session. Fix: ==== During acquisition of the plugins that handle specific events, audit_class_mask contains events of the plugin currently loaded, but excluding bits of audit plugins not loaded. This guarantees that other audit plugis could be loaded later on demand. Acquisition of the plugins that handle connection events, will result in acquisition of the Plugin 'B'. audit_class_mask will contain [ 0x0, 0xf, 0x0, ... ], which represents acquired plugins, excluding plugins that have not been acquired. Generation of the general event will result is reacquisition of the plugins and the audit_class_maks will contain [ 0xf, 0xf, 0x0, ... ] eventually. Reviewers: ========== Georgi Kodinov <georgi.kodinov@oracle.com> Harin Vadodaria <harin.vadodaria@oracle.com>
Loading