]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
udf: Avoid directory type conversion failure due to ENOMEM
authorJan Kara <jack@suse.cz>
Thu, 9 Feb 2023 09:33:09 +0000 (10:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Nov 2024 14:06:26 +0000 (15:06 +0100)
commit8b1d55e43cee631e142d46ee94c91ccd894341e9
treefe02c76198382c36313001e6f74496346ea11f2b
parent5ea4b73e268bf9e1d26271943f2f7c4517253395
udf: Avoid directory type conversion failure due to ENOMEM

commit df97f64dfa317a5485daf247b6c043a584ef95f9 upstream.

When converting directory from in-ICB to normal format, the last
iteration through the directory fixing up directory enteries can fail
due to ENOMEM. We do not expect this iteration to fail since the
directory is already verified to be correct and it is difficult to undo
the conversion at this point. So just use GFP_NOFAIL to make sure the
small allocation cannot fail.

Reported-by: syzbot+111eaa994ff74f8d440f@syzkaller.appspotmail.com
Fixes: 0aba4860b0d0 ("udf: Allocate name buffer in directory iterator on heap")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/udf/directory.c