diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-29 15:51:09 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-29 15:55:07 +0200 |
commit | 6d3356c12e06f72f5c9e381b9e6d5e1fbb1a1bc4 (patch) | |
tree | 7051a2aa7fca2802181eaff444693c9e4ab879e3 /storage/innobase/buf | |
parent | 8cfdddac71eb9451435281c9a9348b4fe224cb89 (diff) | |
download | mariadb-git-6d3356c12e06f72f5c9e381b9e6d5e1fbb1a1bc4.tar.gz |
MDEV-24053 MSAN use-of-uninitialized-value in tpool::simulated_aio::simulated_aio_callback()
Starting with commit ef3f71fa7435f092dfce36d606cf22332218dd8b
MemorySanitizer would complain that we are writing uninitialized
data via the doublewrite buffer.
buf_dblwr_t::add_to_batch(): Zero out any unused part of the
doublewrite buffer, for PAGE_COMPRESSED and ROW_FORMAT=COMPRESSED
tables.
Reviewed by: Eugene Kosov
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r-- | storage/innobase/buf/buf0dblwr.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index a8ae3e2782a..f17cf6cc128 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -736,7 +736,15 @@ void buf_dblwr_t::add_to_batch(const IORequest &request, size_t size) encryption and/or page compression */ void *frame= buf_page_get_frame(request.bpage); - memcpy_aligned<OS_FILE_LOG_BLOCK_SIZE>(p, frame, size); + /* "frame" is at least 1024-byte aligned for ROW_FORMAT=COMPRESSED pages, + and at least srv_page_size (4096-byte) for everything else. */ + memcpy_aligned<UNIV_ZIP_SIZE_MIN>(p, frame, size); + /* fil_page_compress() for page_compressed guarantees 256-byte alignment */ + memset_aligned<256>(p + size, 0, srv_page_size - size); + /* FIXME: Inform the compiler that "size" and "srv_page_size - size" + are integer multiples of 256, so the above can translate into simple + SIMD instructions. Currently, we make no such assumptions about the + non-pointer parameters that are passed to the _aligned templates. */ ut_ad(!request.bpage->zip_size() || request.bpage->zip_size() == size); ut_ad(active_slot->reserved == active_slot->first_free); ut_ad(active_slot->reserved < buf_size); |