1
0
mirror of https://github.com/MariaDB/server.git synced 2025-04-18 21:44:20 +03:00

MDEV-36155: MSAN use-of-uninitialized-value innodb.log_file_size_online

Writing the redo log resized will write uninitialized data. There is
a MEM_MAKE_DEFINED construct in the code to bless this however it was
correct on the initial length, but not the changed length.

The MEM_MAKE_DEFINED is moved earlier in the code where the length
contains the correct value.
This commit is contained in:
Marko Mäkelä 2025-02-26 18:49:15 +11:00 committed by Daniel Black
parent 2c0ba2680b
commit 937ae4137e

View File

@ -1044,12 +1044,13 @@ lsn_t log_t::write_buf() noexcept
the current LSN are generated. */
MEM_MAKE_DEFINED(buf + length, (write_size_1 + 1) - new_buf_free);
buf[length]= 0; /* allow recovery to catch EOF faster */
if (UNIV_LIKELY_NULL(re_write_buf))
MEM_MAKE_DEFINED(re_write_buf + length, (write_size_1 + 1) -
new_buf_free);
length&= ~write_size_1;
memcpy_aligned<16>(flush_buf, buf + length, (new_buf_free + 15) & ~15);
if (UNIV_LIKELY_NULL(re_write_buf))
{
MEM_MAKE_DEFINED(re_write_buf + length, (write_size_1 + 1) -
new_buf_free);
memcpy_aligned<16>(resize_flush_buf, re_write_buf + length,
(new_buf_free + 15) & ~15);
re_write_buf[length + new_buf_free]= 0;