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] ovl: Add check for missing lookup operation on inode
Date: Mon, 18 Nov 2024 17:17:03 +0300 [thread overview]
Message-ID: <20241118141703.28510-1-kovalev@altlinux.org> (raw)
Ensure that the lookup operation is present for the inode in the overlay
filesystem. If the operation is missing, log a warning and return an EIO
error to prevent further issues in the lookup process.
Reported-by: syzbot+a8c9d476508bd14a90e5@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=a8c9d476508bd14a90e5
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/overlayfs/namei.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 5764f91d283e7..a73f37e401cf0 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -1115,6 +1115,13 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
for (i = 0; !d.stop && i < ovl_numlower(poe); i++) {
struct ovl_path lower = ovl_lowerstack(poe)[i];
+ if (!lower.dentry->d_inode->i_op->lookup) {
+ err = -EIO;
+ pr_warn_ratelimited("missing lookup operation for inode %p\n",
+ lower.dentry->d_inode);
+ goto out_put;
+ }
+
if (!ovl_redirect_follow(ofs))
d.last = i == ovl_numlower(poe) - 1;
else if (d.is_dir || !ofs->numdatalayer)
--
2.33.8
next reply other threads:[~2024-11-18 14:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 14:17 Vasiliy Kovalev [this message]
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 ` [PATCH v2] ovl: Filter invalid inodes with missing lookup function Vasiliy Kovalev
2024-11-20 12:34 ` 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=20241118141703.28510-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
all inboxes | Powered by JetHome®