diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-10-13 07:19:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-13 22:15:05 +0300 |
commit | 63be2065bf4d66c50d3d43935c4687d25642dbbd (patch) | |
tree | 44ea498bb7ee2aa9d9294f0eaa13cc7615ec8fee /fs/gfs2 | |
parent | cf08282805374fbf0c3c6a124f8e4687c21c6615 (diff) | |
download | linux-63be2065bf4d66c50d3d43935c4687d25642dbbd.tar.xz |
gfs2_meta: ->mount() can get NULL dev_name
commit 3df629d873f8683af6f0d34dfc743f637966d483 upstream.
get in sync with mount_bdev() handling of the same
Reported-by: syzbot+c54f8e94e6bba03b04e9@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/ops_fstype.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index a3711f543405..28d6c65c8bb3 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1352,6 +1352,9 @@ static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type, struct path path; int error; + if (!dev_name || !*dev_name) + return ERR_PTR(-EINVAL); + error = kern_path(dev_name, LOOKUP_FOLLOW, &path); if (error) { pr_warn("path_lookup on %s returned error %d\n", |