提交 9b6faee0 编写于 作者: A Amir Goldstein 提交者: Miklos Szeredi

ovl: check ERR_PTR() return value from ovl_encode_fh()

Another fix for an issue reported by 0-day robot.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Fixes: 8ed5eec9 ("ovl: encode pure upper file handles")
Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
上级 2aed489d
...@@ -108,6 +108,9 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen) ...@@ -108,6 +108,9 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
/* Encode an upper or origin file handle */ /* Encode an upper or origin file handle */
fh = ovl_encode_fh(origin ?: ovl_dentry_upper(dentry), !origin); fh = ovl_encode_fh(origin ?: ovl_dentry_upper(dentry), !origin);
err = PTR_ERR(fh);
if (IS_ERR(fh))
goto fail;
err = -EOVERFLOW; err = -EOVERFLOW;
if (fh->len > buflen) if (fh->len > buflen)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册