]> git.itanic.dy.fi Git - linux-stable/commit
ext4: improve error handling from ext4_dirhash()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 6 May 2023 15:59:13 +0000 (11:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:30 +0000 (11:50 +0200)
commitb2531936118deb3f479c4fa1bcd787b74b8faa6a
tree7164dcbf744378aed69514d8a3c0c45dff4b15a5
parentb2f1314e6e36e2322554e5e6e9598eedd349d942
ext4: improve error handling from ext4_dirhash()

commit 4b3cb1d108bfc2aebb0d7c8a52261a53cf7f5786 upstream.

The ext4_dirhash() will *almost* never fail, especially when the hash
tree feature was first introduced.  However, with the addition of
support of encrypted, casefolded file names, that function can most
certainly fail today.

So make sure the callers of ext4_dirhash() properly check for
failures, and reflect the errors back up to their callers.

Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20230506142419.984260-1-tytso@mit.edu
Reported-by: syzbot+394aa8a792cb99dbc837@syzkaller.appspotmail.com
Reported-by: syzbot+344aaa8697ebd232bfc8@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=db56459ea4ac4a676ae4b4678f633e55da005a9b
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/hash.c
fs/ext4/namei.c