diff options
Diffstat (limited to 'fs/namei.c')
| -rw-r--r-- | fs/namei.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index df12b576c21..689339e3e7e 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1800,6 +1800,16 @@ 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()) { + path_put(&nd->path); + err = -ENOENT; + } + } + } + if (base) fput(base); |
