udf: Do not bother merging very long extents
authorJan Kara <jack@suse.cz>
Fri, 16 Dec 2022 11:37:51 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:59 +0000 (09:39 +0100)
commit9a8d602f0723586e668bae7e65c832ceb9bcc8bc
tree5d13f8633274b6959f83eee58f7651e21daa05f0
parente43adce883e1895be8fd6babc35209016a7bbebc
udf: Do not bother merging very long extents

commit 53cafe1d6d8ef9f93318e5bfccc0d24f27d41ced upstream.

When merging very long extents we try to push as much length as possible
to the first extent. However this is unnecessarily complicated and not
really worth the trouble. Furthermore there was a bug in the logic
resulting in corrupting extents in the file as syzbot reproducer shows.
So just don't bother with the merging of extents that are too long
together.

CC: stable@vger.kernel.org
Reported-by: syzbot+60f291a24acecb3c2bd5@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/inode.c