Skip to content

Commit 27ab338

Browse files
committed
udf: Fix bogus checksum computation in udf_rename()
Syzbot reports uninitialized memory access in udf_rename() when updating checksum of '..' directory entry of a moved directory. This is indeed true as we pass on-stack diriter.fi to the udf_update_tag() and because that has only struct fileIdentDesc included in it and not the impUse or name fields, the checksumming function is going to checksum random stack contents beyond the end of the structure. This is actually harmless because the following udf_fiiter_write_fi() will recompute the checksum from on-disk buffers where everything is properly included. So all that is needed is just removing the bogus calculation. Fixes: e9109a9 ("udf: Convert udf_rename() to new directory iteration code") Link: https://lore.kernel.org/all/[email protected]/T/ Link: https://patch.msgid.link/[email protected] Reported-by: [email protected] Signed-off-by: Jan Kara <[email protected]>
1 parent 8832fc1 commit 27ab338

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fs/udf/namei.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,6 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
876876
if (has_diriter) {
877877
diriter.fi.icb.extLocation =
878878
cpu_to_lelb(UDF_I(new_dir)->i_location);
879-
udf_update_tag((char *)&diriter.fi,
880-
udf_dir_entry_len(&diriter.fi));
881879
udf_fiiter_write_fi(&diriter, NULL);
882880
udf_fiiter_release(&diriter);
883881
}

0 commit comments

Comments
 (0)