Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-31 Thread Michael Tokarev
30.10.2014 10:10, Markus Armbruster wrote: [] > I'm afraid the commit message is a bit misleading. Let's examine what > exactly happens. > > dump_iterate() dumps blocks in a loop. Eventually, get_next_block() > returns "no more". We then call dump_completed(). But we neglect to > break the loo

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-31 Thread Gonglei
On 2014/10/30 21:54, Michael Tokarev wrote: > So I'm applying this -- which is your patch and your commit message, and > I really wonder why this is Reviewed-by and not Signed-off-by, with your > authorship? It really should be... Yes, maybe it should be. But I have to say something: First, I po

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-31 Thread Gonglei
On 2014/10/31 15:18, Michael Tokarev wrote: > 31.10.2014 04:43, Gonglei wrote: >> On 2014/10/30 21:54, Michael Tokarev wrote: >> >>> So I'm applying this -- which is your patch and your commit message, and >>> I really wonder why this is Reviewed-by and not Signed-off-by, with your >>> authorship?

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-31 Thread Michael Tokarev
31.10.2014 04:43, Gonglei wrote: > On 2014/10/30 21:54, Michael Tokarev wrote: > >> So I'm applying this -- which is your patch and your commit message, and >> I really wonder why this is Reviewed-by and not Signed-off-by, with your >> authorship? It really should be... > > Yes, maybe it should

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-31 Thread Markus Armbruster
Michael Tokarev writes: > 30.10.2014 10:10, Markus Armbruster wrote: > [] >> I'm afraid the commit message is a bit misleading. Let's examine what >> exactly happens. >> >> dump_iterate() dumps blocks in a loop. Eventually, get_next_block() >> returns "no more". We then call dump_completed().

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-30 Thread Gonglei
On 2014/10/30 17:23, Markus Armbruster wrote: > Michael Tokarev writes: > >> 30.10.2014 10:10, Markus Armbruster wrote: >>> writes: >>> From: Gonglei After commit 4c7e251a (), when dump memory completed, the s->fd will be closed twice. We should return directly when du

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-30 Thread Markus Armbruster
Michael Tokarev writes: > 30.10.2014 10:10, Markus Armbruster wrote: >> writes: >> >>> From: Gonglei >>> >>> After commit 4c7e251a (), when dump memory completed, >>> the s->fd will be closed twice. We should return >>> directly when dump completed. >>> >>> Using do/while block, make the badly

Re: [Qemu-devel] [Qemu-trivial] [PATCH v2] dump: fix use-after-free for s->fd

2014-10-30 Thread Michael Tokarev
30.10.2014 10:10, Markus Armbruster wrote: > writes: > >> From: Gonglei >> >> After commit 4c7e251a (), when dump memory completed, >> the s->fd will be closed twice. We should return >> directly when dump completed. >> >> Using do/while block, make the badly chosen return >> values of get_next_