diff options
| author | Tom Marshall <tdm.code@gmail.com> | 2017-05-18 23:50:22 +0000 |
|---|---|---|
| committer | Davide Garberi <dade.garberi@gmail.com> | 2022-07-27 19:23:20 +0200 |
| commit | 919dc57be9bc1fb482a1edba41d4ea6b7f15f5b1 (patch) | |
| tree | 2af452d9dc2d891a2b9a120085603e4799f349b0 /fs | |
| parent | 08ff8a2e58eb226015fa68d577121137a7e0953f (diff) | |
kernel: Fix potential refcount leak in su check
Change-Id: I8d2c8bed65a01eb0928308df638a04449a5bd881
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/namei.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c index 24c8e86449b4..e1d54d342ad5 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2294,8 +2294,10 @@ static int path_lookupat(struct nameidata *nd, unsigned flags, struct path *path 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; + } } } |
