]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vhost: fail early when __vhost_add_used() fails
authorJason Wang <jasowang@redhat.com>
Mon, 14 Jul 2025 08:47:53 +0000 (16:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:25 +0000 (16:28 +0200)
commit110822d339a034b610adb3bc9b7a192cb686bd79
tree5d2655800ac0d701aa99d93d5979795dc4bf0c68
parentc2bdb45f366a90dab68e08a95fb0762ad76a9f68
vhost: fail early when __vhost_add_used() fails

[ Upstream commit b4ba1207d45adaafa2982c035898b36af2d3e518 ]

This patch fails vhost_add_used_n() early when __vhost_add_used()
fails to make sure used idx is not updated with stale used ring
information.

Reported-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20250714084755.11921-2-jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vhost/vhost.c