Skip to content

Use isc_rwlock to lock .logconfig member of isc_log_t

In isc_log_woudlog() the .logconfig member of isc_log_t structure was accessed unlocked on the merit that there could be just a race when .logconfig would be NULL, so the message would not be logged. This turned not to be true, as there's also data race deeper. The accessed isc_logconfig_t object could be in the middle of destruction, so the pointer would be still non-NULL, but the structure members could point to a chunk of memory no longer belonging to the object. Since we are only accessing integer types (the log level), this would never lead to a crash, it leads to memory access to memory area no longer belonging to the object and this a) wrong, b) raises a red flag in thread-safety tools.

(cherry picked from commit 4d58856f)

Closes #1675 (closed)

Merge request reports