Jan Kara 9e951f2d85 udf: Avoid using stale lengthOfImpUse
commit c1ad35dd0548ce947d97aaf92f7f2f9a202951cf upstream.

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: 979a6e28dd96 ("udf: Get rid of 0-length arrays in struct fileIdentDesc")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-15 20:18:52 +02:00
..
2021-11-25 09:48:46 +01:00
2022-05-15 20:18:52 +02:00
2021-08-11 16:54:44 +02:00
2021-11-25 09:48:46 +01:00
2021-08-12 16:07:09 +02:00
2021-08-12 16:07:09 +02:00