[PATCH] ovl: check ERR_PTR() return value from ovl_encode_fh()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Fixes: 8ed5eec9d6c4 ("ovl: encode pure upper file handles")
Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
---

Miklos,

Another fix on top on overlayfs-next, for an issue reported by 0-day robot.

If you are going to squash this one and the other regression fix to
overlayfs-next, just keep in mind that overlayfs-next has already been
merged with Al's for-next branch on linux-next tree to resolve a conflict.

Thanks,
Amir.

 fs/overlayfs/export.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
index b65ea49de457..bb94ce9da5c8 100644
--- a/fs/overlayfs/export.c
+++ b/fs/overlayfs/export.c
@@ -108,6 +108,9 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
 
 	/* Encode an upper or origin file handle */
 	fh = ovl_encode_fh(origin ?: ovl_dentry_upper(dentry), !origin);
+	err = PTR_ERR(fh);
+	if (IS_ERR(fh))
+		goto fail;
 
 	err = -EOVERFLOW;
 	if (fh->len > buflen)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux