[PATCH] l2_packet: Fix valgrind uninitialised byte(s) error messages

Jouni Malinen j at w1.fi
Sat Feb 7 09:58:34 EST 2015


On Sat, Feb 07, 2015 at 01:41:34PM +0200, Jouni Malinen wrote:
> It looks like adding just two bytes to the sockaddr_ll buffer is enough
> to make valgrind not complain. I'm not sure how padding could really
> cause this, though, taken into account how valgrind code for this is
> implemented in pre_mem_read_sockaddr(). That implementation is not aware
> of sockaddr_ll (maybe it would be a good idea to make it aware of
> that..), but it seems to be checking the area following sa_family (i.e.,
> sll_family in sockaddr_ll) in a way that should not go beyond the
> 20-byte buffer regardless of how the fields are padded.

Well.. I was obviously looking at the trunk version of Valgrind rather
than 3.10.0 that is used in Ubuntu 14.10. This was indeed broken and
fixed after that release:
https://bugs.kde.org/show_bug.cgi?id=342221

I confirmed that the issue does not show up with the current Valgrind
trunk snapshot. As such, I'm dropping this l2_packet patch since this
was caused by a Valgrind bug that has already been fixed (but not yet
included in a formal release).

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list