linux/include/net/sctp
Jason Gunthorpe 9302d7bb0c sctp: Fix mangled IPv4 addresses on a IPv6 listening socket
sctp_v4_map_v6 was subtly writing and reading from members
of a union in a way the clobbered data it needed to read before
it read it.

Zeroing the v6 flowinfo overwrites the v4 sin_addr with 0, meaning
that every place that calls sctp_v4_map_v6 gets ::ffff:0.0.0.0 as the
result.

Reorder things to guarantee correct behaviour no matter what the
union layout is.

This impacts user space clients that open an IPv6 SCTP socket and
receive IPv4 connections. Prior to 299ee user space would see a
sockaddr with AF_INET and a correct address, after 299ee the sockaddr
is AF_INET6, but the address is wrong.

Fixes: 299ee123e1 (sctp: Fixup v4mapped behaviour to comply with Sock API)
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-05-27 14:15:26 -04:00
..
auth.h include/net/: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
checksum.h include/net/: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
command.h sctp: handle association restarts when the socket is closed. 2014-10-06 00:21:45 -04:00
constants.h net: sctp: Rename SCTP_XMIT_NAGLE_DELAY to SCTP_XMIT_DELAY 2014-07-22 13:32:11 -07:00
sctp.h sctp: Fix mangled IPv4 addresses on a IPv6 listening socket 2015-05-27 14:15:26 -04:00
sm.h new helper: memcpy_from_msg() 2014-11-24 04:28:48 -05:00
structs.h switch sctp_user_addto_chunk() and sctp_datamsg_from_user() to passing iov_iter 2014-11-24 05:16:40 -05:00
tsnmap.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
ulpevent.h net: sctp: implement rfc6458, 5.3.6. SCTP_NXTINFO cmsg support 2014-07-16 14:40:03 -07:00
ulpqueue.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00