[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools/xg: Fix potential memory leak in cpu policy getters/setters



On Wed, Nov 29, 2023 at 04:00:28PM +0000, Alejandro Vallejo wrote:
> They allocate two different hypercall buffers, but leak the first
> allocation if the second one failed due to an early return that bypasses
> cleanup.
> 
> Remove the early exit and go through _post() instead. Invoking _post() is
> benign even if _pre() failed.
> 
> Fixes: 6b85e427098c ('x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy')
> Fixes: 60529dfeca14 ('x86/domctl: Implement XEN_DOMCTL_get_cpu_policy')
> Fixes: 14ba07e6f816 ('x86/domctl: Implement XEN_DOMCTL_set_cpumsr_policy')
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>

Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.