android_kernel_oneplus_msm8998/drivers/vhost
Jason Wang 5e6b394621 vhost_net: validate sock before trying to put its fd
[ Upstream commit b8f1f65882f07913157c44673af7ec0b308d03eb ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-22 14:25:53 +02:00
..
Kconfig vhost: cross-endian support for legacy devices 2015-06-01 15:48:55 +02:00
Makefile vhost: Make vhost a separate module 2013-07-07 17:33:44 +03:00
net.c vhost_net: validate sock before trying to put its fd 2018-07-22 14:25:53 +02:00
scsi.c fix a page leak in vhost_scsi_iov_to_sgl() error recovery 2017-11-30 08:37:22 +00:00
test.c vhost: move features to core 2015-09-16 12:48:07 +03:00
test.h vhost test module 2010-12-09 16:00:21 +02:00
vhost.c vhost: correctly remove wait queue during poll failure 2018-04-13 19:50:25 +02:00
vhost.h vhost: fix performance on LE hosts 2015-10-27 20:17:03 -07:00
vringh.c vringh: update for virtio 1.0 APIs 2014-12-15 23:49:28 +02:00