ext4: add missing validation of fast-commit record lengths
authorEric Biggers <ebiggers@kernel.org>
Thu, 5 Jan 2023 07:13:57 +0000 (23:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:59:05 +0000 (11:59 +0100)
commit9c197dcbacc4662aea893b2440c60908e5228e79
tree144f7ab87a33bc9ebed61b6cffd99ab7b9d3a94a
parent6220ec405571ded17efedc56587190b542adf246
ext4: add missing validation of fast-commit record lengths

From: Eric Biggers <ebiggers@google.com>

commit 64b4a25c3de81a69724e888ec2db3533b43816e2 upstream.

Validate the inode and filename lengths in fast-commit journal records
so that a malicious fast-commit journal cannot cause a crash by having
invalid values for these.  Also validate EXT4_FC_TAG_DEL_RANGE.

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