提交 f598f9f1 编写于 作者: A Al Viro

Sanitize autofs_dev_ioctl_ismountpoint()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 b1e4594b
...@@ -544,10 +544,9 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp, ...@@ -544,10 +544,9 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
goto out; goto out;
devid = new_encode_dev(path.mnt->mnt_sb->s_dev); devid = new_encode_dev(path.mnt->mnt_sb->s_dev);
err = 0; err = 0;
if (path.dentry->d_inode && if (path.mnt->mnt_root == path.dentry) {
path.mnt->mnt_root == path.dentry) {
err = 1; err = 1;
magic = path.dentry->d_inode->i_sb->s_magic; magic = path.mnt->mnt_sb->s_magic;
} }
} else { } else {
dev_t dev = sbi->sb->s_dev; dev_t dev = sbi->sb->s_dev;
...@@ -560,11 +559,9 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp, ...@@ -560,11 +559,9 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
err = have_submounts(path.dentry); err = have_submounts(path.dentry);
if (path.mnt->mnt_mountpoint != path.mnt->mnt_root) {
if (follow_down(&path)) if (follow_down(&path))
magic = path.mnt->mnt_sb->s_magic; magic = path.mnt->mnt_sb->s_magic;
} }
}
param->ismountpoint.out.devid = devid; param->ismountpoint.out.devid = devid;
param->ismountpoint.out.magic = magic; param->ismountpoint.out.magic = magic;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册