[Devel] [PATCH RHEL9 COMMIT] drivers/vhost: Fix uninitialized variable in vhost_work_queue()

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jul 15 18:26:58 MSK 2024


The commit is pushed to "branch-rh9-5.14.0-427.22.1.vz9.62.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-427.22.1.vz9.62.5
------>
commit f73bb8faefb12bac57af9eabea1f769827ad2ec9
Author: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
Date:   Mon Jul 15 15:49:50 2024 +0200

    drivers/vhost: Fix uninitialized variable in vhost_work_queue()
    
    Set the index variable to zero before passing its pointer to xa_find().
    
    Fixes: 17ad03ac78b9 ("drivers/vhost: fix missing rcu_read_lock in vhost_work_queue")
    https://virtuozzo.atlassian.net/browse/PSBM-157296
    
    Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
    
    Feature: vhost-blk: in-kernel accelerator for virtio-blk guests
---
 drivers/vhost/vhost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index c551e8d215b6..1eac6e2f62a5 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -258,7 +258,7 @@ static bool vhost_worker_queue(struct vhost_worker *worker,
 bool vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
 {
 	struct vhost_worker *worker;
-	unsigned long i;
+	unsigned long i = 0;
 
 	worker = xa_find(&dev->worker_xa, &i, ULONG_MAX, XA_PRESENT);
 	if (!worker)


More information about the Devel mailing list