Richard Alpe ddb3712552 tipc: safely copy UDP netlink data from user
The netlink policy for TIPC_NLA_UDP_LOCAL and TIPC_NLA_UDP_REMOTE
is of type binary with a defined length. This causes the policy
framework to threat the defined length as maximum length.

There is however no protection against a user sending a smaller
amount of data. Prior to this patch this wasn't handled which could
result in a partially incomplete sockaddr_storage struct containing
uninitialized data.

In this patch we use nla_memcpy() when copying the user data. This
ensures a potential gap at the end is cleared out properly.

This was found by Julia with Coccinelle tool.

Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-06 22:54:57 -05:00
..
2015-03-02 16:43:41 -05:00
2015-11-30 14:47:33 -05:00
2016-03-01 17:36:47 -05:00
2015-10-13 17:42:34 +02:00
2016-02-04 18:26:08 +01:00
2016-03-02 15:00:55 -05:00
2015-11-23 14:56:15 -05:00
2016-03-02 15:00:55 -05:00
2016-03-03 17:26:18 -05:00
2015-10-23 03:05:19 -07:00
2016-02-21 22:00:28 -05:00
2016-01-04 21:48:15 -05:00