mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
vhost: reject backend enable without a kick file
Enabling a backend without VHOST_SET_VRING_KICK dereferences a NULL
vq->kick in vhost_poll_start(). Reject the request with -EINVAL.
Fixes: 264ee5aa81 ("tools/virtio: Add --reset")
Assisted-by: OpenAI-Codex:GPT-5.6
Signed-off-by: Linfeng Sun <linfeng.sun.dev@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20261011-fix-null-pointer-in-vhost_test_set_backend-v1-1-60b2f12d64c6@gmail.com>
This commit is contained in:
parent
a543346b96
commit
509f6bd229
|
|
@ -287,6 +287,10 @@ static long vhost_test_set_backend(struct vhost_test *n, unsigned index, int fd)
|
|||
r = -EFAULT;
|
||||
goto err_vq;
|
||||
}
|
||||
if (enable && !vq->kick) {
|
||||
r = -EINVAL;
|
||||
goto err_vq;
|
||||
}
|
||||
if (!enable) {
|
||||
vhost_poll_stop(&vq->poll);
|
||||
backend = vhost_vq_get_backend(vq);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user