Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Дмитрий Фролов
On 11.10.2023 17:33, Juan Quintela wrote: Peter Xu wrote: On Wed, Oct 11, 2023 at 04:20:42PM +0300, Дмитрий Фролов wrote: I do not insist on accepting this patch - it is more like RFC. Also, i can add more verbose message and assert, if necessary. That's totally fine. It's just that then we s

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Juan Quintela
Peter Xu wrote: > On Wed, Oct 11, 2023 at 04:20:42PM +0300, Дмитрий Фролов wrote: >> I do not insist on accepting this patch - it is more like RFC. >> Also, i can add more verbose message and assert, if necessary. > > That's totally fine. It's just that then we should drop the Fixes line > above b

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Peter Xu
On Wed, Oct 11, 2023 at 04:20:42PM +0300, Дмитрий Фролов wrote: > I do not insist on accepting this patch - it is more like RFC. > Also, i can add more verbose message and assert, if necessary. That's totally fine. It's just that then we should drop the Fixes line above because it doesn't need to

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Дмитрий Фролов
On 10.10.2023 22:23, Peter Xu wrote: On Tue, Oct 10, 2023 at 01:48:53PM +0300, Dmitry Frolov wrote: qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o AFAIU this path is only called from trusted sites, so I don't see why it can be NULL? Do you have any scenario that

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-11 Thread Juan Quintela
Dmitry Frolov wrote: > qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o > check. Usualy return value is checked for this function. > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: c7c0e72408df5e7821c0e995122fb2fe0ac001f1 ("migration/ram: Hand

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-10 Thread Peter Xu
On Tue, Oct 10, 2023 at 01:48:53PM +0300, Dmitry Frolov wrote: > qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o AFAIU this path is only called from trusted sites, so I don't see why it can be NULL? Do you have any scenario that can trigger this? > check. Usualy return

Re: [PATCH v1] migration: fix RAMBlock add NULL check

2023-10-10 Thread Fabiano Rosas
Dmitry Frolov writes: > qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o > check. Usualy return value is checked for this function. > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: c7c0e72408df5e7821c0e995122fb2fe0ac001f1 ("migration/ram: Ha

[PATCH v1] migration: fix RAMBlock add NULL check

2023-10-10 Thread Dmitry Frolov
qemu_ram_block_from_host() may return NULL, which will be dereferenced w/o check. Usualy return value is checked for this function. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c7c0e72408df5e7821c0e995122fb2fe0ac001f1 ("migration/ram: Handle RAM block resizes during pr