Skip to content

Commit c7242a4

Browse files
committed
ovl: fix NULL pointer defer when encoding non-decodable lower fid
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]>
1 parent a535116 commit c7242a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/overlayfs/export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static int ovl_check_encode_origin(struct dentry *dentry)
188188

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

193193
/* Upper file handle for pure upper */
194194
if (!ovl_dentry_lower(dentry))

0 commit comments

Comments
 (0)