diff options
author | Tomas Bortoli <tomasbortoli@gmail.com> | 2018-07-27 14:05:58 +0300 |
---|---|---|
committer | Dominique Martinet <dominique.martinet@cea.fr> | 2018-08-13 03:34:58 +0300 |
commit | 10aa14527f458e9867cf3d2cc6b8cb0f6704448b (patch) | |
tree | 528cd65953fc42890ac1e51ff452d148133a2734 /net/9p/trans_virtio.c | |
parent | 3111784bee81591ea2815011688d28b65df03627 (diff) |
9p: fix multiple NULL-pointer-dereferences
Added checks to prevent GPFs from raising.
Link: http://lkml.kernel.org/r/20180727110558.5479-1-tomasbortoli@gmail.com
Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+1a262da37d3bead15c39@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Diffstat (limited to 'net/9p/trans_virtio.c')
-rw-r--r-- | net/9p/trans_virtio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 06dcd3cc6a29..8ca356eb66bb 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -654,6 +654,9 @@ p9_virtio_create(struct p9_client *client, const char *devname, char *args) int ret = -ENOENT; int found = 0; + if (devname == NULL) + return -EINVAL; + mutex_lock(&virtio_9p_lock); list_for_each_entry(chan, &virtio_chan_list, chan_list) { if (!strncmp(devname, chan->tag, chan->tag_len) && |