summaryrefslogtreecommitdiff
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-10-03 09:21:27 +0300
committerAmir Goldstein <amir73il@gmail.com>2023-10-03 09:24:11 +0300
commitc7242a45cb8cad5b6cd840fd4661315b45b1e841 (patch)
tree173fad06099094e5f53a9872c5416c1d534a9581 /fs/overlayfs
parenta535116d80339dbfe50b9b81b2f808c69eefbbc3 (diff)
downloadlinux-c7242a45cb8cad5b6cd840fd4661315b45b1e841.tar.xz
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: syzbot+2208f82282740c1c8915@syzkaller.appspotmail.com Fixes: 16aac5ad1fa9 ("ovl: support encoding non-decodable file handles") Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
index c8c8588bd98c..26b782c53910 100644
--- a/fs/overlayfs/export.c
+++ b/fs/overlayfs/export.c
@@ -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))