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.
This commit is contained in:
Marko Mäkelä 2017-09-07 12:01:07 +03:00
parent ee844f6c34
commit d861822c4f
2 changed files with 2 additions and 0 deletions

View File

@ -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);

View File

@ -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);