aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Marshall <tdm.code@gmail.com>2017-05-18 23:50:22 +0000
committerAndreas Blaesius <skate4life@gmx.de>2017-06-07 16:50:23 +0200
commitcf8656e992e8c1f9417fae91ed389628e8686046 (patch)
treeb006940bccb4c119ce8025e87189b82fda3ea9ef
parentc89ce3e20e86206d3211df1308bc232b5f9852a8 (diff)
downloadkernel_samsung_espresso10-cf8656e992e8c1f9417fae91ed389628e8686046.zip
kernel_samsung_espresso10-cf8656e992e8c1f9417fae91ed389628e8686046.tar.gz
kernel_samsung_espresso10-cf8656e992e8c1f9417fae91ed389628e8686046.tar.bz2
kernel: Fix potential refcount leak in su check
Change-Id: I8d2c8bed65a01eb0928308df638a04449a5bd881
-rw-r--r--fs/namei.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index c202c8d..e0957f2 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1626,8 +1626,10 @@ static int path_lookupat(int dfd, const char *name,
if (!err) {
struct super_block *sb = nd->inode->i_sb;
if (sb->s_flags & MS_RDONLY) {
- if (d_is_su(nd->path.dentry) && !su_visible())
+ if (d_is_su(nd->path.dentry) && !su_visible()) {
+ path_put(&nd->path);
err = -ENOENT;
+ }
}
}