Skip to content

Commit bf44471

Browse files
author
Miklos Szeredi
committed
ovl: Filter invalid inodes with missing lookup function
JIRA: https://issues.redhat.com/browse/RHEL-72307 CVE: CVE-2024-56570 Add a check to the ovl_dentry_weird() function to prevent the processing of directory inodes that lack the lookup function. This is important because such inodes can cause errors in overlayfs when passed to the lowerstack. Reported-by: syzbot+a8c9d476508bd14a90e5@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=a8c9d476508bd14a90e5 Suggested-by: Miklos Szeredi <miklos@szeredi.hu> Link: https://lore.kernel.org/linux-unionfs/CAJfpegvx-oS9XGuwpJx=Xe28_jzWx5eRo1y900_ZzWY+=gGzUg@mail.gmail.com/ Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> Cc: <stable@vger.kernel.org> Signed-off-by: Amir Goldstein <amir73il@gmail.com> (cherry picked from commit c8b359d) Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 8987e6b commit bf44471

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/overlayfs/util.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ void ovl_dentry_init_flags(struct dentry *dentry, struct dentry *upperdentry,
171171

172172
bool ovl_dentry_weird(struct dentry *dentry)
173173
{
174+
if (!d_can_lookup(dentry) && !d_is_file(dentry) && !d_is_symlink(dentry))
175+
return true;
176+
174177
return dentry->d_flags & (DCACHE_NEED_AUTOMOUNT |
175178
DCACHE_MANAGE_TRANSIT |
176179
DCACHE_OP_HASH |

0 commit comments

Comments
 (0)