Re: [PATCH 1/2] qemu/queue.h: clear linked list pointers on remove

2020-02-25 Thread Stefan Hajnoczi
On Mon, Feb 24, 2020 at 12:51:54PM +0100, Philippe Mathieu-Daudé wrote: > On 2/24/20 11:34 AM, Stefan Hajnoczi wrote: > > @@ -304,8 +310,10 @@ struct { > > \ > > } while (/*CONSTCOND*/0) > > #define QSIMPLEQ_REMOVE_HEAD(head, field

Re: [PATCH 1/2] qemu/queue.h: clear linked list pointers on remove

2020-02-24 Thread Philippe Mathieu-Daudé
On 2/24/20 11:34 AM, Stefan Hajnoczi wrote: Do not leave stale linked list pointers around after removal. It's safer to set them to NULL so that use-after-removal results in an immediate segfault. The RCU queue removal macros are unchanged since nodes may still be traversed after removal. Sugg

[PATCH 1/2] qemu/queue.h: clear linked list pointers on remove

2020-02-24 Thread Stefan Hajnoczi
Do not leave stale linked list pointers around after removal. It's safer to set them to NULL so that use-after-removal results in an immediate segfault. The RCU queue removal macros are unchanged since nodes may still be traversed after removal. Suggested-by: Paolo Bonzini Signed-off-by: Stefan