linux/net/tipc
Mathias Krause 60085c3d00 tipc: fix info leaks via msg_name in recv_msg/recv_stream
The code in set_orig_addr() does not initialize all of the members of
struct sockaddr_tipc when filling the sockaddr info -- namely the union
is only partly filled. This will make recv_msg() and recv_stream() --
the only users of this function -- leak kernel stack memory as the
msg_name member is a local variable in net/socket.c.

Additionally to that both recv_msg() and recv_stream() fail to update
the msg_namelen member to 0 while otherwise returning with 0, i.e.
"success". This is the case for, e.g., non-blocking sockets. This will
lead to a 128 byte kernel stack leak in net/socket.c.

Fix the first issue by initializing the memory of the union with
memset(0). Fix the second one by setting msg_namelen to 0 early as it
will be updated later if we're going to fill the msg_name member.

Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-07 16:28:02 -04:00
..
Kconfig net/tipc: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:40:02 -08:00
Makefile
addr.c
addr.h
bcast.c tipc: fix missing spinlock init in broadcast code 2013-02-15 15:40:56 -05:00
bcast.h
bearer.c
bearer.h
config.c
config.h
core.c
core.h
discover.c
discover.h
eth_media.c
handler.c
link.c tipc: remove obsolete flush of stale reassembly buffer 2012-12-06 17:20:19 -05:00
link.h
log.c
msg.c
msg.h
name_distr.c
name_distr.h
name_table.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
name_table.h
net.c
net.h
netlink.c
node.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
node.h
node_subscr.c
node_subscr.h
port.c tipc: standardize across connect/disconnect function naming 2012-12-07 17:23:19 -05:00
port.h tipc: standardize across connect/disconnect function naming 2012-12-07 17:23:19 -05:00
ref.c
ref.h
socket.c tipc: fix info leaks via msg_name in recv_msg/recv_stream 2013-04-07 16:28:02 -04:00
subscr.c tipc: standardize across connect/disconnect function naming 2012-12-07 17:23:19 -05:00
subscr.h