Skip to contentSkip to conversation

ovl: check ERR_PTR() return value from ovl_lookup_real()

PATCH In review Amir Goldstein 1 participant 2 messages Jan 30, 2018 – Feb 6, 2018 Overlay filesystem

lore
Share & tools
lore

Amir Goldstein

author maintainer
#0 lore raw

PATCH 1/1 ovl: check ERR_PTR() return value from ovl_lookup_real()

Fixes 061701540349 ("ovl: lookup indexed ancestor of lower dir")

---
Miklos,

Another fix, for yet another issue reported by 0-day robot. At least it looks like the smatch checker got to the last patch ;-).

All 3 fixes over overlayfs-next are push to branch ovl-nfs-export on my github.

Thanks,
Amir.

 fs/overlayfs/export.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/overlayfs/export.c +2 -2
index bb94ce9da5c8..07d70255095b 100644
@@ -355,8 +355,8 @@ static struct dentry *ovl_lookup_real_inode(struct super_block *sb,
 		dput(upper);
 	}
 
-	if (!this)
-		return NULL;
+	if (IS_ERR_OR_NULL(this))
+		return this;
 
 	if (WARN_ON(ovl_dentry_real_at(this, layer->idx) != real)) {
 		dput(this);
Signature · 1 line
2.7.4
author maintainer
#1 lore raw
Quoted 8 lines · Amir Goldstein
Fixes 061701540349 ("ovl: lookup indexed ancestor of lower dir")

---
Miklos,

Another fix, for yet another issue reported by 0-day robot. At least it looks like the smatch checker got to the last patch ;-).

Miklos,

I guess you missed this patch when updated for-linus, because subject looks very similar the the "other" 0-day reported bug fix?

Quoted 4 lines

All 3 fixes over overlayfs-next are push to branch ovl-nfs-export on my github.

At this time, my ovl-nfs-export is rebased on current master and has all the patches that are candidates for rc2 (including this fix). The branch also contains "hash by file handle" work, which is now complete. Will be posting it shortly.

Thanks,
Amir.

Quoted 22 lines
 fs/overlayfs/export.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/overlayfs/export.c +2 -3
index bb94ce9da5c8..07d70255095b 100644
@@ -355,8 +355,8 @@ static struct dentry *ovl_lookup_real_inode(struct super_block *sb,
                dput(upper);
        }
 
-       if (!this)
-               return NULL;
+       if (IS_ERR_OR_NULL(this))
+               return this;
 
        if (WARN_ON(ovl_dentry_real_at(this, layer->idx) != real)) {
                dput(this);
--

2.7.4