Skip to contentSkip to conversation

libxl: correctly dispose of dominfo list in libxl_name_to_domid

PATCH In review Wei Liu 3 participants 4 messages Jan 29, 2019 – Feb 5, 2019

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl: correctly dispose of dominfo list in libxl_name_to_domid

Tamas reported ssid_label was leaked. Use the designated function to free dominfo list to fix the leakage.

---
Backport candidate.

---
 tools/libxl/libxl_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_utils.c +1 -1
index e50e094c48..f360f5e228 100644
@@ -90,7 +90,7 @@ int libxl_name_to_domid(libxl_ctx *ctx, const char *name,
         }
         free(domname);
     }
-    free(dominfo);
+    libxl_dominfo_list_free(dominfo, nb_domains);
     return ret;
 }
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 6 lines · Wei Liu

Tamas reported ssid_label was leaked. Use the designated function to free dominfo list to fix the leakage.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Wei Liu

Wei Liu writes ("[PATCH for-4.12] libxl: correctly dispose of dominfo list in libxl_name_to_domid"):

Quoted 6 lines

Tamas reported ssid_label was leaked. Use the designated function to free dominfo list to fix the leakage.

Quoted 1 line

Backport candidate.

Noted.

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw

Ian Jackson writes ("Re: [PATCH for-4.12] libxl: correctly dispose of dominfo list in libxl_name_to_domid"):

Quoted 8 lines

Wei Liu writes ("[PATCH for-4.12] libxl: correctly dispose of dominfo list in libxl_name_to_domid"):

Quoted 6 lines

Tamas reported ssid_label was leaked. Use the designated function to free dominfo list to fix the leakage.

Quoted 5 lines
Quoted 1 line

Backport candidate.

Noted.

For reference:

This bug was first introduced in

35c1498503216510095745d06d09f0f01ddf800e
libxenlight: fix name to domid conversion

where the call to libxl_domain_list was introduced. A fix was attempted in

cbc97d570c09ff9a1db5af18f5e5db5565ab3506
libxenlight: fix memory leaks

which is where the `free(dominfo)' call was introduced, but that was not right. That latter commit is in staging-3.4. So all supported (and security-supported) versions are affected. I have backported this to 4.10 and 4.11. (As it doesn't seem to me to be a security issue I have not fixed it on earlier branches.)

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel