From: Markus Elfring <Markus.Elfring@web.de>
To: Wang Zhaolong <wangzhaolong1@huawei.com>, linux-unionfs@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Amir Goldstein <amir73il@gmail.com>,
Miklos Szeredi <miklos@szeredi.hu>,
Yang Erkun <yangerkun@huawei.com>, Zhang Yi <yi.zhang@huawei.com>
Subject: Re: [PATCH] overlayfs: fix potential NULL pointer dereferences in file handle code
Date: Mon, 28 Apr 2025 13:48:20 +0200 [thread overview]
Message-ID: <0b8cbc01-0db9-48ae-ae13-7158a94a8908@web.de> (raw)
In-Reply-To: <20250428111136.290004-1-wangzhaolong1@huawei.com>
…
> +++ b/fs/overlayfs/namei.c
> @@ -496,10 +496,13 @@ static int ovl_verify_fh(struct ovl_fs *ofs, struct dentry *dentry,
> enum ovl_xattr ox, const struct ovl_fh *fh)
> {
> struct ovl_fh *ofh = ovl_get_fh(ofs, dentry, ox);
> int err = 0;
>
> + if (!fh)
> + return -ENODATA;
> +
> if (!ofh)
> return -ENODATA;
…
How do you think about to reduce the scope for these local variables
(according to adjustment possibilities for input parameter validation)?
Regards,
Markus
next prev parent reply other threads:[~2025-04-28 11:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 11:11 Wang Zhaolong
2025-04-28 11:48 ` Markus Elfring [this message]
2025-04-28 13:01 ` Wang Zhaolong
2025-04-29 0:13 Wang Zhaolong
2025-04-29 12:01 ` Miklos Szeredi
2025-04-30 9:56 ` Wang Zhaolong
2025-04-29 18:34 ` Markus Elfring
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=0b8cbc01-0db9-48ae-ae13-7158a94a8908@web.de \
--to=markus.elfring@web.de \
--cc=amir73il@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=wangzhaolong1@huawei.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
/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®