]> 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)
commitbb7f57a07c60625db110f0c2b2ea9d6430800bfa
tree8c521e3875bf2837889b9a7df519363ebe013870
parent1a4af290ff787c467c8d8a8195a7acf39563f6ba
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: ad6b01e9c3fb ("udf: Get rid of 0-length arrays in struct fileIdentDesc")
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/namei.c