ext4: fix unaligned memory access in ext4_fc_reserve_space()
authorEric Biggers <ebiggers@kernel.org>
Thu, 5 Jan 2023 07:13:58 +0000 (23:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:59:05 +0000 (11:59 +0100)
commitb205332b6b87dacec803925342a1e662be1053e7
treee5b573d89b29f098a1967f7ad42b30b21577b992
parent9c197dcbacc4662aea893b2440c60908e5228e79
ext4: fix unaligned memory access in ext4_fc_reserve_space()

From: Eric Biggers <ebiggers@google.com>

commit 8415ce07ecf0cc25efdd5db264a7133716e503cf upstream.

As is done elsewhere in the file, build the struct ext4_fc_tl on the
stack and memcpy() it into the buffer, rather than directly writing it
to a potentially-unaligned location in the buffer.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Cc: <stable@vger.kernel.org> # v5.10+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20221106224841.279231-6-ebiggers@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/fast_commit.c