[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] tools/libs/light: Fix nic->vlan memory allocation
On Mon, May 20, 2024 at 01:08:03PM -0400, Jason Andryuk wrote: > On 2024-05-20 12:44, Leigh Brown wrote: > > After the following commit: > > 3bc14e4fa4b9 ("tools/libs/light: Add vlan field to libxl_device_nic") > > xl list -l aborts with a double free error if a domain has at least > > one vif defined: > > > > $ sudo xl list -l > > free(): double free detected in tcache 2 > > Aborted > > > > Orginally, the vlan field was called vid and was defined as an integer. > > It was appropriate to call libxl__xs_read_checked() with gc passed as > > the string data was copied to a different variable. However, the final > > version uses a string data type and the call should have been changed > > to use NOGC instead of gc to allow that data to live past the gc > > controlled lifetime, in line with the other string fields. > > > > This patch makes the change to pass NOGC instead of gc and moves the > > new code to be next to the other string fields (fixing a couple of > > errant tabs along the way), as recommended by Jason. > > > > Fixes: 3bc14e4fa4b9 ("tools/libs/light: Add vlan field to libxl_device_nic") > > Signed-off-by: Leigh Brown <leigh@xxxxxxxxxxxxx> > > Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx> Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx> Thanks, -- Anthony Perard | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |