]> git.baikalelectronics.ru Git - kernel.git/commit
net/vmw_vsock: fix NULL pointer dereference
authorNorbert Slusarek <nslusarek@gmx.net>
Fri, 5 Feb 2021 12:12:06 +0000 (13:12 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Feb 2021 23:03:17 +0000 (15:03 -0800)
commit4cb822af754976fd9be2046aaca2ff1ecdb1dc6f
treec7b2e72fa255c7080b07753bf70bbd4100b2f067
parente2053c8c8a145ca7e0e4950fdc631c4082aa9e30
net/vmw_vsock: fix NULL pointer dereference

In vsock_stream_connect(), a thread will enter schedule_timeout().
While being scheduled out, another thread can enter vsock_stream_connect()
as well and set vsk->transport to NULL. In case a signal was sent, the
first thread can leave schedule_timeout() and vsock_transport_cancel_pkt()
will be called right after. Inside vsock_transport_cancel_pkt(), a null
dereference will happen on transport->cancel_pkt.

Fixes: 377128ab2681 ("vsock: add multi-transports support")
Signed-off-by: Norbert Slusarek <nslusarek@gmx.net>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/trinity-c2d6cede-bfb1-44e2-85af-1fbc7f541715-1612535117028@3c-app-gmx-bap12
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/af_vsock.c