From: Vasiliy Kovalev <kovalev@altlinux.org>
To: Miklos Szeredi <miklos@szeredi.hu>,
Amir Goldstein <amir73il@gmail.com>,
linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kovalev@altlinux.org
Subject: [PATCH v2] ovl: Filter invalid inodes with missing lookup function
Date: Tue, 19 Nov 2024 18:58:17 +0300 [thread overview]
Message-ID: <20241119155817.83651-1-kovalev@altlinux.org> (raw)
In-Reply-To: <CAOQ4uxhc9-MMF1nEpoxC5X41FRqSygGdVcTuvdJKurMxWU1U0Q@mail.gmail.com>
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>
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
Cc: <stable@vger.kernel.org>
---
fs/overlayfs/util.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 3bb107471fb42..9aa7493b1e103 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 |
--
2.33.8
next prev parent reply other threads:[~2024-11-19 15:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 14:17 [PATCH] ovl: Add check for missing lookup operation on inode Vasiliy Kovalev
2024-11-18 18:54 ` Amir Goldstein
2024-11-19 9:05 ` Miklos Szeredi
2024-11-19 14:33 ` Vasiliy Kovalev
2024-11-19 15:11 ` Amir Goldstein
2024-11-19 15:58 ` Vasiliy Kovalev [this message]
2024-11-20 12:34 ` [PATCH v2] ovl: Filter invalid inodes with missing lookup function Amir Goldstein
2024-11-23 0:21 ` [PATCH] ovl: Add check for missing lookup operation on inode Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241119155817.83651-1-kovalev@altlinux.org \
--to=kovalev@altlinux.org \
--cc=amir73il@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox