Skip to content

Commit cf9070a

Browse files
committed
Merge 10.1 into 10.2
2 parents 0b73b96 + 50c9469 commit cf9070a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

extra/mariabackup/fil_cur.cc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,16 @@ static bool page_is_corrupted(byte *page, ulint page_no, xb_fil_cur_t *cursor,
314314
return false;
315315
}
316316

317-
/* Validate encrypted pages. */
318-
if (mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION)
319-
&& (space->crypt_data
320-
&& space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED)) {
317+
/* Validate encrypted pages. The first page is never encrypted.
318+
In the system tablespace, the first page would be written with
319+
FIL_PAGE_FILE_FLUSH_LSN at shutdown, and if the LSN exceeds
320+
4,294,967,295, the mach_read_from_4() below would wrongly
321+
interpret the page as encrypted. We prevent that by checking
322+
page_no first. */
323+
if (page_no
324+
&& mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION)
325+
&& space->crypt_data
326+
&& space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED) {
321327

322328
if (!fil_space_verify_crypt_checksum(page, cursor->page_size))
323329
return true;

mysql-test/suite/mariabackup/huge_lsn.opt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
--innodb-encrypt-log=ON
2+
--innodb-tablespaces-encryption
3+
--innodb-encrypt-tables=ON
4+
--innodb-encryption-rotate-key-age=1
5+
--innodb-encryption-threads=4
26
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
37
--loose-file-key-management
48
--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key

0 commit comments

Comments
 (0)