]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
udf: Avoid using stale lengthOfImpUse
authorJan Kara <jack@suse.cz>
Tue, 10 May 2022 10:36:04 +0000 (12:36 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:22:02 +0000 (09:22 +0200)
commitf26391f2a7b7c36884fcc7152462a9aae255a671
tree777b6af4ad9b1924c53c7bcb66fd4558d0e07130
parent2e5946fc05b11bafd338353fee810e3856c61c1b
udf: Avoid using stale lengthOfImpUse

BugLink: https://bugs.launchpad.net/bugs/1980277
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/udf/namei.c