Commit d861822c authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-13253 After rebuilding redo logs, InnoDB can leak data from redo log buffer

recv_reset_logs(): Initialize the redo log buffer, so that no data
from the old redo log can be written to the new redo log.

This bug has very little impact before MariaDB 10.2. The
innodb_log_encrypt option that was introduced in MariaDB 10.1
increases the impact. If the redo log used to be encrypted, and
it is being resized and encryption disabled, then previously
encrypted data could end up being written to the new redo log
in clear text. This resulted in encryption.innodb_encrypt_log
test failures in MariaDB 10.2.
parent ee844f6c
......@@ -3472,6 +3472,7 @@ recv_reset_logs(
log_sys->archived_lsn = log_sys->lsn;
#endif /* UNIV_LOG_ARCHIVE */
memset(log_sys->buf, 0, log_sys->buf_size);
log_block_init(log_sys->buf, log_sys->lsn);
log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE);
......
......@@ -3574,6 +3574,7 @@ recv_reset_logs(
log_sys->tracked_lsn = log_sys->lsn;
memset(log_sys->buf, 0, log_sys->buf_size);
log_block_init(log_sys->buf, log_sys->lsn);
log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment