qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] Fix use after free in vfio_migration_probe
@ 2020-11-06 18:02 Kirti Wankhede
  2020-11-12 15:57 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Kirti Wankhede @ 2020-11-06 18:02 UTC (permalink / raw)
  To: alex.williamson, cjia; +Cc: mcrossley, Kirti Wankhede, qemu-devel, dnigam

Fixes Coverity issue:
CID 1436126:  Memory - illegal accesses  (USE_AFTER_FREE)

Fixes: a9e271ec9b36 ("vfio: Add migration region initialization and finalize
function")

Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: David Edmondson <dme@dme.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/vfio/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 3ce285ea395d..55261562d4f3 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -897,8 +897,8 @@ int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
         goto add_blocker;
     }
 
-    g_free(info);
     trace_vfio_migration_probe(vbasedev->name, info->index);
+    g_free(info);
     return 0;
 
 add_blocker:
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] Fix use after free in vfio_migration_probe
  2020-11-06 18:02 [PATCH v2 1/1] Fix use after free in vfio_migration_probe Kirti Wankhede
@ 2020-11-12 15:57 ` Peter Maydell
  2020-11-12 16:59   ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2020-11-12 15:57 UTC (permalink / raw)
  To: Kirti Wankhede
  Cc: mcrossley, Alex Williamson, Neo Jia, QEMU Developers, dnigam

On Fri, 6 Nov 2020 at 18:35, Kirti Wankhede <kwankhede@nvidia.com> wrote:
>
> Fixes Coverity issue:
> CID 1436126:  Memory - illegal accesses  (USE_AFTER_FREE)
>
> Fixes: a9e271ec9b36 ("vfio: Add migration region initialization and finalize
> function")
>
> Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
> Reviewed-by: David Edmondson <dme@dme.org>
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---

Hi Alex -- this is a fix for a Coverity issue, are you planning
a pullreq with it in? It would be nice to have it in rc2 next week.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] Fix use after free in vfio_migration_probe
  2020-11-12 15:57 ` Peter Maydell
@ 2020-11-12 16:59   ` Alex Williamson
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2020-11-12 16:59 UTC (permalink / raw)
  To: Peter Maydell; +Cc: mcrossley, Kirti Wankhede, Neo Jia, QEMU Developers, dnigam

On Thu, 12 Nov 2020 15:57:46 +0000
Peter Maydell <peter.maydell@linaro.org> wrote:

> On Fri, 6 Nov 2020 at 18:35, Kirti Wankhede <kwankhede@nvidia.com> wrote:
> >
> > Fixes Coverity issue:
> > CID 1436126:  Memory - illegal accesses  (USE_AFTER_FREE)
> >
> > Fixes: a9e271ec9b36 ("vfio: Add migration region initialization and finalize
> > function")
> >
> > Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
> > Reviewed-by: David Edmondson <dme@dme.org>
> > Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---  
> 
> Hi Alex -- this is a fix for a Coverity issue, are you planning
> a pullreq with it in? It would be nice to have it in rc2 next week.

Hi Peter,

Yes, I was planning to send a pull request.  It's a trivial and obvious
fix, so if by chance you'd like to grab it separately, you're also more
than welcome.

Acked-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>

Thanks,
Alex



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-12 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-06 18:02 [PATCH v2 1/1] Fix use after free in vfio_migration_probe Kirti Wankhede
2020-11-12 15:57 ` Peter Maydell
2020-11-12 16:59   ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).