It appears sockaddr_in.sin_zero is not zeroed during certain operations
returning IPv4 socket names, namely:
- getsockopt(...SO_ORIGINAL_DST...) (2.4 and 2.6)
see getorigdst() in net/ipv4/netfilter/ip_conntrack_core.c
(+ in net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c in 2.6?!)
- getsockname() and getpeername() (and accept()) (2.4 only)
see inet_getname() in net/ipv4/af_inet.c
and several unitialized bytes of kernel stack (sizeof(sin_zero) == 6 to be
precise) leak to the userspace.
A patch has been included in Marcelo's 2.4 tree:
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.