]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()
authorNikolay Kuratov <kniv@yandex-team.ru>
Mon, 11 Dec 2023 16:23:17 +0000 (19:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2023 14:32:34 +0000 (15:32 +0100)
commitad2ecbdc29909424cc34b7383faf8a7c7585cf52
tree8dff425e0d2df87107287849edec49f0f8cfe9df
parent1a455a1ddb0b77a6118f001f1d397bd2edc87e06
vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space()

[ Upstream commit 60316d7f10b17a7ebb1ead0642fee8710e1560e0 ]

We need to do signed arithmetic if we expect condition
`if (bytes < 0)` to be possible

Found by Linux Verification Center (linuxtesting.org) with SVACE

Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko")
Signed-off-by: Nikolay Kuratov <kniv@yandex-team.ru>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20231211162317.4116625-1-kniv@yandex-team.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/vmw_vsock/virtio_transport_common.c