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

Denis V. Lunev den at virtuozzo.com
Wed Jul 17 21:53:27 MSK 2024


On 7/16/24 04:39, Pavel Tikhomirov wrote:
> Nice catch!
>
> On 7/15/24 21:49, Alexander Ivanov wrote:
>> 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
>
> Reviewed-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
>
>> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
>> ---
>>   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)
>
could this affect so called "stalled" packets problem?

This smells worth to add to ongoing RK.

Den


More information about the Devel mailing list