Skip to contentSkip to conversation

Fix use after free in vfio_migration_probe

PATCH In review Kirti Wankhede 3 participants 3 messages Nov 6, 2020 – Nov 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix use after free in vfio_migration_probe

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

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

function")

---
 hw/vfio/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/migration.c +1 -1
index 3ce285ea395d..55261562d4f3 100644
@@ -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:
Signature · 1 line
2.7.0
#1 lore raw
Quoted 4 lines · Kirti Wankhede

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

Quoted 8 lines
Fixes a9e271ec9b36 ("vfio: Add migration region initialization and finalize

function")

---

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

Acked-by Reviewed-by
#2 lore raw
Quoted 8 lines · On Thu, 12 Nov 2020 15:57:46 +0000 Peter Maydell <[email protected]>…
Quoted 7 lines · Kirti Wankhede

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

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

function")

Quoted 8 lines
Quoted 5 lines

---

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.

Thanks,
Alex