]> Git Repo - linux.git/commitdiff
ovl: Filter invalid inodes with missing lookup function
authorVasiliy Kovalev <[email protected]>
Tue, 19 Nov 2024 15:58:17 +0000 (18:58 +0300)
committerAmir Goldstein <[email protected]>
Wed, 20 Nov 2024 09:23:04 +0000 (10:23 +0100)
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: [email protected]
Link: https://syzkaller.appspot.com/bug?extid=a8c9d476508bd14a90e5
Suggested-by: Miklos Szeredi <[email protected]>
Link: https://lore.kernel.org/linux-unionfs/CAJfpegvx-oS9XGuwpJx=Xe28_jzWx5eRo1y900_ZzWY+=gGzUg@mail.gmail.com/
Signed-off-by: Vasiliy Kovalev <[email protected]>
Cc: <[email protected]>
Signed-off-by: Amir Goldstein <[email protected]>
fs/overlayfs/util.c

index 3bb107471fb42c9589b3eee44ff33059a7dcd2a0..9aa7493b1e10365cbcc97fceab26d614a319727f 100644 (file)
@@ -202,6 +202,9 @@ void ovl_dentry_init_flags(struct dentry *dentry, struct dentry *upperdentry,
 
 bool ovl_dentry_weird(struct dentry *dentry)
 {
+       if (!d_can_lookup(dentry) && !d_is_file(dentry) && !d_is_symlink(dentry))
+               return true;
+
        return dentry->d_flags & (DCACHE_NEED_AUTOMOUNT |
                                  DCACHE_MANAGE_TRANSIT |
                                  DCACHE_OP_HASH |
This page took 0.056765 seconds and 4 git commands to generate.