[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH for-4.5 v2] libxc: don't leak buffer containing the uncompressed PV kernel
On 11/20/2014 10:13 PM, Gedalya wrote: For the record, I applied it again the xen package currently in debian, 4.4.1-3, see attached patch. The only problem was that tools/libxc/include/xc_dom.h is in tools/libxc/xc_dom.h, otherwise it applied fine.On 11/20/2014 03:21 PM, Konrad Rzeszutek Wilk wrote:On Thu, Nov 20, 2014 at 03:48:47PM +0000, Ian Campbell wrote:The libxc xc_dom_* infrastructure uses a very simple malloc memory pool which is freed by xc_dom_release. However the various xc_try_*_decode routines (other than the gzip one) just use plain malloc/realloc and therefore the buffer endsup leaked. The memory pool currently supports mmap'd buffers as well as a directlyallocated buffers, however the try decode routines make use of realloc and do not fit well into this model. Introduce a concept of an external memory blockto the memory pool and provide an interface to register such memory.The mmap_ptr and mmap_len fields of the memblock tracking struct lose theirmmap_ prefix since they are now also used for external memory blocks.We are only seeing this now because the gzip decoder doesn't leak and it's onlyrelatively recently that kernels in the wild have switched to better compression. This is https://bugs.debian.org/767295 Reported by: Gedalya <gedalya@xxxxxxxxxxx>Gedelya, Could you also test this patch to make sure it does fix the reported issue please?So here's what happens now. 1. Starts up tiny 2. reboot: leak3. reboot: freed (process larger, but the delta is all/mostly shared pages)4. reboot: leak 5. reboot: freed etc.. Attachment:
0039-libxc-dont-leak-buffer-containing-the-uncompressed-pv-kernel _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |