ext4: fix unaligned memory access in ext4_fc_reserve_space()
authorEric Biggers <ebiggers@google.com>
Sun, 6 Nov 2022 22:48:39 +0000 (14:48 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 9 Dec 2022 02:49:24 +0000 (21:49 -0500)
commit8415ce07ecf0cc25efdd5db264a7133716e503cf
tree7b7fe1b7e4087e00be9c041c3d7f53840c5103b5
parent64b4a25c3de81a69724e888ec2db3533b43816e2
ext4: fix unaligned memory access in ext4_fc_reserve_space()

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>
fs/ext4/fast_commit.c