Re: [PATCH v3] exec: set map length to zero when returning NULL

2020-05-26 Thread P J P
+-- On Tue, 26 May 2020, Peter Maydell wrote --+ | The doc comment for this function in include/exec/memory.h currently says | | "May return %NULL if resources needed to perform the mapping | are exhausted." | | If we're tightening the API to guarantee to also set *plen to 0 in this | failure c

Re: [PATCH v3] exec: set map length to zero when returning NULL

2020-05-26 Thread Peter Maydell
On Tue, 26 May 2020 at 08:53, P J P wrote: > > From: Prasad J Pandit > > When mapping physical memory into host's virtual address space, > 'address_space_map' may return NULL if BounceBuffer is in_use. > Set and return '*plen = 0' to avoid later NULL pointer dereference. > > Reported-by: Alexande

Re: [PATCH v3] exec: set map length to zero when returning NULL

2020-05-26 Thread Philippe Mathieu-Daudé
On Tue, May 26, 2020 at 9:53 AM P J P wrote: > > From: Prasad J Pandit > > When mapping physical memory into host's virtual address space, > 'address_space_map' may return NULL if BounceBuffer is in_use. > Set and return '*plen = 0' to avoid later NULL pointer dereference. > > Reported-by: Alexan

Re: [PATCH v3] exec: set map length to zero when returning NULL

2020-05-26 Thread Philippe Mathieu-Daudé
On 5/26/20 9:50 AM, P J P wrote: > From: Prasad J Pandit > > When mapping physical memory into host's virtual address space, > 'address_space_map' may return NULL if BounceBuffer is in_use. > Set and return '*plen = 0' to avoid later NULL pointer dereference. > > Reported-by: Alexander Bulekov

[PATCH v3] exec: set map length to zero when returning NULL

2020-05-26 Thread P J P
From: Prasad J Pandit When mapping physical memory into host's virtual address space, 'address_space_map' may return NULL if BounceBuffer is in_use. Set and return '*plen = 0' to avoid later NULL pointer dereference. Reported-by: Alexander Bulekov Fixes: https://bugs.launchpad.net/qemu/+bug/187