1
0
Fork 0
alistair23-linux/drivers/vhost
Jason Wang b8f1f65882 vhost_net: validate sock before trying to put its fd
Sock will be NULL if we pass -1 to vhost_net_set_backend(), but when
we meet errors during ubuf allocation, the code does not check for
NULL before calling sockfd_put(), this will lead NULL
dereferencing. Fixing by checking sock pointer before.

Fixes: bab632d69e ("vhost: vhost TX zero-copy support")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-23 10:23:49 +09:00
..
Kconfig tap: tap as an independent module 2017-02-11 20:59:41 -05:00
Kconfig.vringh vhost: split out vringh Kconfig 2016-08-02 16:54:28 +03:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
net.c vhost_net: validate sock before trying to put its fd 2018-06-23 10:23:49 +09:00
scsi.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
test.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
test.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vhost.c virtio, vhost: features, fixes 2018-06-16 06:35:02 +09:00
vhost.h vhost: return bool from *_access_ok() functions 2018-04-11 10:54:06 -04:00
vringh.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
vsock.c fw_cfg, vhost: features fixes 2018-04-06 19:21:41 -07:00