summaryrefslogtreecommitdiffstats
path: root/net/9p/trans_xen.c
diff options
context:
space:
mode:
authorTomas Bortoli <tomasbortoli@gmail.com>2018-07-27 13:05:58 +0200
committerDominique Martinet <dominique.martinet@cea.fr>2018-08-13 02:34:58 +0200
commit10aa14527f458e9867cf3d2cc6b8cb0f6704448b (patch)
tree528cd65953fc42890ac1e51ff452d148133a2734 /net/9p/trans_xen.c
parentfs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed (diff)
downloadlinux-10aa14527f458e9867cf3d2cc6b8cb0f6704448b.tar.xz
linux-10aa14527f458e9867cf3d2cc6b8cb0f6704448b.zip
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_xen.c')
-rw-r--r--net/9p/trans_xen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/9p/trans_xen.c b/net/9p/trans_xen.c
index 2e2b8bca54f3..c2d54ac76bfd 100644
--- a/net/9p/trans_xen.c
+++ b/net/9p/trans_xen.c
@@ -94,6 +94,9 @@ static int p9_xen_create(struct p9_client *client, const char *addr, char *args)
{
struct xen_9pfs_front_priv *priv;
+ if (addr == NULL)
+ return -EINVAL;
+
read_lock(&xen_9pfs_lock);
list_for_each_entry(priv, &xen_9pfs_devs, list) {
if (!strcmp(priv->tag, addr)) {