udf: Protect rename against modification of moved directory
authorJan Kara <jack@suse.cz>
Wed, 18 Jan 2023 18:42:35 +0000 (19:42 +0100)
committerJan Kara <jack@suse.cz>
Thu, 26 Jan 2023 15:46:34 +0000 (16:46 +0100)
commitf950fd0529130a617b3da526da9fb6a896ce87c2
treea89823d9ba8c1ef7ff5719cd1c2c05e2a4ee3902
parent32f123a3f34283f9c6446de87861696f0502b02e
udf: Protect rename against modification of moved directory

When we are renaming a directory to a different directory, we need to
update '..' entry in the moved directory. However nothing prevents moved
directory from being modified and even converted from the in-ICB format
to the normal format which results in a crash. Fix the problem by
locking the moved directory.

Reported-by: syzbot+aebf90eea2671c43112a@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/namei.c