Skip to content

Commit

Permalink
ovl: check ERR_PTR() return value from ovl_encode_fh()
Browse files Browse the repository at this point in the history
Another fix for an issue reported by 0-day robot.

Reported-by: Dan Carpenter <[email protected]>
Fixes: 8ed5eec ("ovl: encode pure upper file handles")
Signed-off-by: Amir Goldstein <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
amir73il authored and Miklos Szeredi committed Feb 5, 2018
1 parent 2aed489 commit 9b6faee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/overlayfs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9b6faee

Please sign in to comment.