Skip to content

Commit

Permalink
ovl: fix NULL pointer defer when encoding non-decodable lower fid
Browse files Browse the repository at this point in the history
A wrong return value from ovl_check_encode_origin() would cause
ovl_dentry_to_fid() to try to encode fid from NULL upper dentry.

Reported-by: [email protected]
Fixes: 16aac5a ("ovl: support encoding non-decodable file handles")
Signed-off-by: Amir Goldstein <[email protected]>
  • Loading branch information
amir73il committed Oct 3, 2023
1 parent a535116 commit c7242a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/overlayfs/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int ovl_check_encode_origin(struct dentry *dentry)

/* Lower file handle for non-upper non-decodable */
if (!ovl_dentry_upper(dentry) && !decodable)
return 0;
return 1;

/* Upper file handle for pure upper */
if (!ovl_dentry_lower(dentry))
Expand Down

0 comments on commit c7242a4

Please sign in to comment.