[PATCH] libnl: report an error if unexpected control data was received

Thomas Haller thaller at redhat.com
Mon Sep 21 03:00:58 PDT 2015


On Mon, 2015-09-14 at 18:59 +0300, Andrey Vagin wrote:
> Currently, we try to handle MSG_CTRUNC, but if msg_controllen is
> zero, we make
> double free for the same address.
> 
> realloc(0, 0) returns non-zero address
> realloc(addr, 0) returns zero and free(addr) has already been called
> 
> Then we call free(addr) again and get an error like this:

Hi Andrey,


could you elaborate a bit on the circumstances when you hit this error?
Did the kernel set msg_controllen to zero? Do you know why?


Anyway, thanks for the patch!!
Applied as https://github.com/thom311/libnl/commit/fd9d1da28c9d989f88b6c5edaa352c01976f82ac



Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20150921/bc45ea7a/attachment.sig>


More information about the libnl mailing list