]> git.baikalelectronics.ru Git - kernel.git/commit
vsock: avoid to assign transport if its initialization fails
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 21 Nov 2019 09:06:09 +0000 (10:06 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Nov 2019 19:37:16 +0000 (11:37 -0800)
commitf9f21642b67c26a86d30ac23b20ed8bdfade2057
tree4818e35b1ac78089c6425093a69d32cb6e6b2f48
parentd5cf3624912b24428c1d183edd5f01c610e7aa35
vsock: avoid to assign transport if its initialization fails

If transport->init() fails, we can't assign the transport to the
socket, because it's not initialized correctly, and any future
calls to the transport callbacks would have an unexpected behavior.

Fixes: 377128ab2681 ("vsock: add multi-transports support")
Reported-and-tested-by: syzbot+e2e5c07bf353b2f79daa@syzkaller.appspotmail.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/af_vsock.c