Re: [PATCH] vfio: Fix null pointer dereference bug in vfio_bars_finalize()

2023-07-04 Thread Avihai Horon
On 03/07/2023 19:56, Philippe Mathieu-Daudé wrote: External email: Use caution opening links or attachments On 3/7/23 18:39, Avihai Horon wrote: vfio_realize() has the following flow: 1. vfio_bars_prepare() -- sets VFIOBAR->size. 2. msix_early_setup(). 3. vfio_bars_register() -- allocates VF

Re: [PATCH] vfio: Fix null pointer dereference bug in vfio_bars_finalize()

2023-07-03 Thread Philippe Mathieu-Daudé
On 3/7/23 18:39, Avihai Horon wrote: vfio_realize() has the following flow: 1. vfio_bars_prepare() -- sets VFIOBAR->size. 2. msix_early_setup(). 3. vfio_bars_register() -- allocates VFIOBAR->mr. After vfio_bars_prepare() is called msix_early_setup() can fail. If it does fail, vfio_bars_register(

[PATCH] vfio: Fix null pointer dereference bug in vfio_bars_finalize()

2023-07-03 Thread Avihai Horon
vfio_realize() has the following flow: 1. vfio_bars_prepare() -- sets VFIOBAR->size. 2. msix_early_setup(). 3. vfio_bars_register() -- allocates VFIOBAR->mr. After vfio_bars_prepare() is called msix_early_setup() can fail. If it does fail, vfio_bars_register() is never called and VFIOBAR->mr is no