OSDN Git Service

gfs2_meta: ->mount() can get NULL dev_name
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 13 Oct 2018 04:19:13 +0000 (00:19 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Nov 2018 08:27:34 +0000 (09:27 +0100)
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>
fs/gfs2/ops_fstype.c

index baab99b..d917838 100644 (file)
@@ -1353,6 +1353,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",