[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b8cbc01-0db9-48ae-ae13-7158a94a8908@web.de>
Date: Mon, 28 Apr 2025 13:48:20 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Wang Zhaolong <wangzhaolong1@...wei.com>, linux-unionfs@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, Amir Goldstein <amir73il@...il.com>,
Miklos Szeredi <miklos@...redi.hu>, Yang Erkun <yangerkun@...wei.com>,
Zhang Yi <yi.zhang@...wei.com>
Subject: Re: [PATCH] overlayfs: fix potential NULL pointer dereferences in
file handle code
…
> +++ 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
Powered by blists - more mailing lists