diff options
| author | Vasiliy Kovalev <[email protected]> | 2024-11-19 15:58:17 +0000 |
|---|---|---|
| committer | Amir Goldstein <[email protected]> | 2024-11-20 09:23:04 +0000 |
| commit | c8b359dddb418c60df1a69beea01d1b3322bfe83 (patch) | |
| tree | 544c9498f5e0615df5455c8f43ecc941ec73dd46 /fs/overlayfs/util.c | |
| parent | ovl: convert ovl_real_fdget() callers to ovl_real_file() (diff) | |
| download | kernel-c8b359dddb418c60df1a69beea01d1b3322bfe83.tar.gz kernel-c8b359dddb418c60df1a69beea01d1b3322bfe83.zip | |
ovl: Filter invalid inodes with missing lookup function
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]>
Diffstat (limited to 'fs/overlayfs/util.c')
| -rw-r--r-- | fs/overlayfs/util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 3bb107471fb4..9aa7493b1e10 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -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 | |
