diff options
author | Tomas Bortoli <tomasbortoli@gmail.com> | 2018-07-27 13:05:58 +0200 |
---|---|---|
committer | Dominique Martinet <dominique.martinet@cea.fr> | 2018-08-13 02:34:58 +0200 |
commit | 10aa14527f458e9867cf3d2cc6b8cb0f6704448b (patch) | |
tree | 528cd65953fc42890ac1e51ff452d148133a2734 /net/9p/trans_fd.c | |
parent | fs/9p/xattr.c: catch the error of p9_client_clunk when setting xattr failed (diff) | |
download | linux-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_fd.c')
-rw-r--r-- | net/9p/trans_fd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index 964260265b13..e2ef3c782c53 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -945,7 +945,7 @@ p9_fd_create_tcp(struct p9_client *client, const char *addr, char *args) if (err < 0) return err; - if (valid_ipaddr4(addr) < 0) + if (addr == NULL || valid_ipaddr4(addr) < 0) return -EINVAL; csocket = NULL; @@ -995,6 +995,9 @@ p9_fd_create_unix(struct p9_client *client, const char *addr, char *args) csocket = NULL; + if (addr == NULL) + return -EINVAL; + if (strlen(addr) >= UNIX_PATH_MAX) { pr_err("%s (%d): address too long: %s\n", __func__, task_pid_nr(current), addr); |