Re: [PATCH net-XXX] vhost-vdpa: fix use after free in vhost_vdpa_probe()

2023-10-31 Thread Michael S. Tsirkin
On Fri, Oct 27, 2023 at 03:12:54PM +0300, Dan Carpenter wrote: > The put_device() calls vhost_vdpa_release_dev() which calls > ida_simple_remove() and frees "v". So this call to > ida_simple_remove() is a use after free and a double free. > > Fixes: ebe6a354fa7e ("vhost-vdpa: Call ida_simple_remo

Re: [PATCH net-XXX] vhost-vdpa: fix use after free in vhost_vdpa_probe()

2023-10-31 Thread Jason Wang
On Fri, Oct 27, 2023 at 8:13 PM Dan Carpenter wrote: > > The put_device() calls vhost_vdpa_release_dev() which calls > ida_simple_remove() and frees "v". So this call to > ida_simple_remove() is a use after free and a double free. > > Fixes: ebe6a354fa7e ("vhost-vdpa: Call ida_simple_remove() whe

Re: [PATCH] virtio_pci: move structure to a header

2023-10-31 Thread Xuan Zhuo
On Tue, 31 Oct 2023 12:19:54 -0400, "Michael S. Tsirkin" wrote: > These are guest/host interfaces so belong in the header > where e.g. qemu will know to find them. > Note: we added a new structure as opposed to extending existing one > because someone might be relying on the size of the existing

Re: [PATCH] virtio_pci: move structure to a header

2023-10-31 Thread Jason Wang
On Wed, Nov 1, 2023 at 12:20 AM Michael S. Tsirkin wrote: > > These are guest/host interfaces so belong in the header > where e.g. qemu will know to find them. > Note: we added a new structure as opposed to extending existing one > because someone might be relying on the size of the existing struc

Re: [PATCH] vdpa_sim_blk: allocate the buffer zeroed

2023-10-31 Thread Jason Wang
On Wed, Nov 1, 2023 at 1:52 AM Eugenio Perez Martin wrote: > > On Tue, Oct 31, 2023 at 3:44 PM Stefano Garzarella > wrote: > > > > Deleting and recreating a device can lead to having the same > > content as the old device, so let's always allocate buffers > > completely zeroed out. > > > > Fixes

Re: [PATCH v4] ALSA: virtio: use ack callback

2023-10-31 Thread Stefano Garzarella
On Fri, Oct 27, 2023 at 10:10:30AM -0400, Michael S. Tsirkin wrote: On Fri, Oct 27, 2023 at 12:18:00PM +0200, Stefano Garzarella wrote: On Fri, Oct 27, 2023 at 11:27:40AM +0200, Takashi Iwai wrote: > On Wed, 25 Oct 2023 11:49:19 +0200, > Matias Ezequiel Vara Larsen wrote: > > > > This commit use

[PATCH] virtio_pci: move structure to a header

2023-10-31 Thread Michael S. Tsirkin
These are guest/host interfaces so belong in the header where e.g. qemu will know to find them. Note: we added a new structure as opposed to extending existing one because someone might be relying on the size of the existing structure staying unchanged. Add a warning to avoid using sizeof. Signed

[PATCH] vdpa_sim_blk: allocate the buffer zeroed

2023-10-31 Thread Stefano Garzarella
Deleting and recreating a device can lead to having the same content as the old device, so let's always allocate buffers completely zeroed out. Fixes: abebb16254b3 ("vdpa_sim_blk: support shared backend") Suggested-by: Qing Wang Signed-off-by: Stefano Garzarella --- drivers/vdpa/vdpa_sim/vdpa_s

RE: [PATCH V2 vfio 2/9] virtio-pci: Introduce admin virtqueue

2023-10-31 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Tuesday, October 31, 2023 1:29 PM > > On Tue, Oct 31, 2023 at 03:11:57AM +, Parav Pandit wrote: > > > > > > > From: Michael S. Tsirkin > > > Sent: Tuesday, October 31, 2023 5:02 AM > > > > > > On Mon, Oct 30, 2023 at 06:10:06PM +, Parav Pandit wrote:

Re: [PATCH V2 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-31 Thread Michael S. Tsirkin
On Tue, Oct 31, 2023 at 10:30:41AM +0200, Yishai Hadas wrote: > > And further, is caller expected not to invoke several of these > > in parallel on the same device? If yes this needs to be > > documented. I don't see where does vfio enforce this if yes. > Please have a look at virtiovf_issue_legacy

Re: [PATCH V2 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-31 Thread Yishai Hadas via Virtualization
On 31/10/2023 10:09, Michael S. Tsirkin wrote: On Sun, Oct 29, 2023 at 05:59:49PM +0200, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. It includes: io_legacy_read/write for both common and the device registers, io_legacy_notify_info. In addition, exposing an API to ch

Re: [PATCH V2 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-31 Thread Michael S. Tsirkin
On Tue, Oct 31, 2023 at 04:17:45PM +0800, Yi Liu wrote: > a dumb question. Is it common between all virtio devices that the legay > interface is in BAR0? It has to be, that is where the legacy driver is looking for it. ___ Virtualization mailing list Vi

Re: [PATCH V2 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-31 Thread Michael S. Tsirkin
On Sun, Oct 29, 2023 at 05:59:49PM +0200, Yishai Hadas wrote: > Introduce APIs to execute legacy IO admin commands. > > It includes: io_legacy_read/write for both common and the device > registers, io_legacy_notify_info. > > In addition, exposing an API to check whether the legacy IO commands are

Re: [PATCH V2 vfio 2/9] virtio-pci: Introduce admin virtqueue

2023-10-31 Thread Michael S. Tsirkin
On Tue, Oct 31, 2023 at 03:11:57AM +, Parav Pandit wrote: > > > > From: Michael S. Tsirkin > > Sent: Tuesday, October 31, 2023 5:02 AM > > > > On Mon, Oct 30, 2023 at 06:10:06PM +, Parav Pandit wrote: > > > > > > > > > > From: Michael S. Tsirkin > > > > Sent: Monday, October 30, 2023 9