diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-10-13 00:19:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-13 11:08:43 -0800 |
commit | 8c448126af0e8fb16ef43303aa30890baa6f4e78 (patch) | |
tree | aa428326bda45224c2a6717d8d559d7d02089227 | |
parent | 25881163ae1f2d26458a6c57aabff41787ef8a69 (diff) | |
download | linux-stable-8c448126af0e8fb16ef43303aa30890baa6f4e78.tar.gz linux-stable-8c448126af0e8fb16ef43303aa30890baa6f4e78.tar.bz2 linux-stable-8c448126af0e8fb16ef43303aa30890baa6f4e78.zip |
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>
-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 c2469833b4fb..6b84ef6ccff3 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1333,6 +1333,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", |