MDEV-18279 MLOG_FILE_WRITE_CRYPT_DATA fails to set the crypt_data->type for tablespace.
Problem: ======== MLOG_FILE_WRITE_CRYPT_DATA redo log fails to apply type for the crypt_data present in the space. While processing the double-write buffer pages, page fails to decrypt. It leads to warning message. Fix: ==== Set the type while parsing MLOG_FILE_WRITE_CRYPT_DATA redo log. If type and length is of invalid type then mark it as corrupted.
This commit is contained in:
parent
a84be48e00
commit
ad376a05fa
@ -529,10 +529,12 @@ fil_parse_write_crypt_data(
|
||||
uint len = mach_read_from_1(ptr);
|
||||
ptr += 1;
|
||||
|
||||
ut_a(type == CRYPT_SCHEME_UNENCRYPTED ||
|
||||
type == CRYPT_SCHEME_1); // only supported
|
||||
if ((type != CRYPT_SCHEME_1 && type != CRYPT_SCHEME_UNENCRYPTED)
|
||||
|| len != CRYPT_SCHEME_1_IV_LEN) {
|
||||
*err = DB_CORRUPTION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ut_a(len == CRYPT_SCHEME_1_IV_LEN); // only supported
|
||||
uint min_key_version = mach_read_from_4(ptr);
|
||||
ptr += 4;
|
||||
|
||||
@ -551,6 +553,7 @@ fil_parse_write_crypt_data(
|
||||
crypt_data->page0_offset = offset;
|
||||
crypt_data->min_key_version = min_key_version;
|
||||
crypt_data->encryption = encryption;
|
||||
crypt_data->type = type;
|
||||
memcpy(crypt_data->iv, ptr, len);
|
||||
ptr += len;
|
||||
|
||||
|
@ -529,10 +529,12 @@ fil_parse_write_crypt_data(
|
||||
uint len = mach_read_from_1(ptr);
|
||||
ptr += 1;
|
||||
|
||||
ut_a(type == CRYPT_SCHEME_UNENCRYPTED ||
|
||||
type == CRYPT_SCHEME_1); // only supported
|
||||
if ((type != CRYPT_SCHEME_1 && type != CRYPT_SCHEME_UNENCRYPTED)
|
||||
|| len != CRYPT_SCHEME_1_IV_LEN) {
|
||||
*err = DB_CORRUPTION;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ut_a(len == CRYPT_SCHEME_1_IV_LEN); // only supported
|
||||
uint min_key_version = mach_read_from_4(ptr);
|
||||
ptr += 4;
|
||||
|
||||
@ -551,6 +553,7 @@ fil_parse_write_crypt_data(
|
||||
crypt_data->page0_offset = offset;
|
||||
crypt_data->min_key_version = min_key_version;
|
||||
crypt_data->encryption = encryption;
|
||||
crypt_data->type = type;
|
||||
memcpy(crypt_data->iv, ptr, len);
|
||||
ptr += len;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user