]> git.baikalelectronics.ru Git - kernel.git/commit
udf: Avoid using stale lengthOfImpUse
authorJan Kara <jack@suse.cz>
Tue, 10 May 2022 10:36:04 +0000 (12:36 +0200)
committerJan Kara <jack@suse.cz>
Tue, 10 May 2022 11:30:32 +0000 (13:30 +0200)
commit6624bb1099f063e61b5403c07d4ecfb7c59075f0
tree8c521e3875bf2837889b9a7df519363ebe013870
parent1509e96a7f42358985da5058fdba278a596743df
udf: Avoid using stale lengthOfImpUse

udf_write_fi() uses lengthOfImpUse of the entry it is writing to.
However this field has not yet been initialized so it either contains
completely bogus value or value from last directory entry at that place.
In either case this is wrong and can lead to filesystem corruption or
kernel crashes.

Reported-by: butt3rflyh4ck <butterflyhuangxx@gmail.com>
CC: stable@vger.kernel.org
Fixes: 714251660b67 ("udf: Get rid of 0-length arrays in struct fileIdentDesc")
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/namei.c