linux/drivers/vhost
Jason Wang 81aca22428 vhost_net: validate sock before trying to put its fd
commit b8f1f65882 upstream.

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: Ben Hutchings <ben@decadent.org.uk>
History 2018-11-20 18:05:25 +00:00
..
Kconfig vhost: Make vhost a separate module 2013-07-07 17:33:44 +03: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-11-20 18:05:25 +00:00
scsi.c vhost/scsi: potential memory corruption 2015-03-03 14:26:02 +00:00
test.c vhost: move memory pointer to VQs 2014-06-09 16:21:07 +03:00
test.h vhost test module 2010-12-09 16:00:21 +02:00
vhost.c drivers/vhost: Fix mmu_context.h assumption 2018-01-09 00:35:08 +00:00
vhost.h vhost: move memory pointer to VQs 2014-06-09 16:21:07 +03:00
vringh.c Add missing module license tag to vring helpers. 2013-05-08 10:49:03 +09:30