lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c2f3cd6c-6f75-15db-080e-9895a35a0456@redhat.com>
Date:   Tue, 2 Jun 2020 19:10:38 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>, kbuild@...ts.01.org,
        Zhu Lingshan <lingshan.zhu@...el.com>, mst@...hat.com,
        kvm@...r.kernel.org, virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Cc:     lkp@...el.com, kbuild-all@...ts.01.org, lulu@...hat.com,
        dan.daly@...el.com, cunming.liang@...el.com
Subject: Re: [PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick


On 2020/6/2 下午6:16, Jason Wang wrote:
>
> On 2020/6/2 下午5:42, Dan Carpenter wrote:
>> Hi Zhu,
>>
>> url: 
>> https://github.com/0day-ci/linux/commits/Zhu-Lingshan/vdpa-bypass-waking-up-vhost_woker-for-vdpa-vq-kick/20200526-133819 
>>
>> base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git 
>> linux-next
>> config: x86_64-randconfig-m001-20200529 (attached as .config)
>> compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kbuild test robot <lkp@...el.com>
>> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
>>
>> smatch warnings:
>> drivers/vhost/vdpa.c:348 vhost_vdpa_set_vring_kick() error: 
>> uninitialized symbol 'r'.
>>
>> # 
>> https://github.com/0day-ci/linux/commit/a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d 
>>
>> git remote add linux-review https://github.com/0day-ci/linux
>> git remote update linux-review
>> git checkout a84ddbf1ef29f18aafb2bb8a93bcedd4a29a967d
>> vim +/r +348 drivers/vhost/vdpa.c
>>
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  316  static long 
>> vhost_vdpa_set_vring_kick(struct vhost_virtqueue *vq,
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 317                        
>> void __user *argp)
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  318  {
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  319      bool pollstart = 
>> false, pollstop = false;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  320      struct file 
>> *eventfp, *filep = NULL;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  321      struct 
>> vhost_vring_file f;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  322      long r;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  323
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  324      if 
>> (copy_from_user(&f, argp, sizeof(f)))
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  325          return -EFAULT;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  326
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  327      eventfp = f.fd == -1 
>> ? NULL : eventfd_fget(f.fd);
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  328      if (IS_ERR(eventfp)) {
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  329          r = 
>> PTR_ERR(eventfp);
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  330          return r;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  331      }
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  332
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  333      if (eventfp != 
>> vq->kick) {
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  334          pollstop = 
>> (filep = vq->kick) != NULL;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  335          pollstart = 
>> (vq->kick = eventfp) != NULL;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  336      } else
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  337          filep = eventfp;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  338
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  339      if (pollstop && 
>> vq->handle_kick)
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  340 vhost_vdpa_poll_stop(vq);
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  341
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  342      if (filep)
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  343 fput(filep);
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  344
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  345      if (pollstart && 
>> vq->handle_kick)
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  346          r = 
>> vhost_vdpa_poll_start(vq);
>>
>> "r" not initialized on else path.
>>
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  347
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26 @348      return r;
>> a84ddbf1ef29f1 Zhu Lingshan 2020-05-26  349  }
>
>
> Will fix.
>
> Thanks 


Lingshan reminds me that we've posted V2 which reuses the vhost.c 
implementation for polling.

So there's no need for the fix.

Thanks



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ