]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix nl compat regression for link statistics
authorRichard Alpe <richard.alpe@ericsson.com>
Fri, 1 Jul 2016 09:11:21 +0000 (11:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Jul 2016 20:47:38 +0000 (16:47 -0400)
commitb1c07fe5d63a557f392b7b9e5cae1f61b9d16e45
tree0cb62f0b56846452a22feebad21d22fb0844bffd
parentc89cc0e6f93b182551d52afb01924b6c42fd5783
tipc: fix nl compat regression for link statistics

Fix incorrect use of nla_strlcpy() where the first NLA_HDRLEN bytes
of the link name where left out.

Making the output of tipc-config -ls look something like:
Link statistics:
dcast-link
1:data0-1.1.2:data0
1:data0-1.1.3:data0

Also, for the record, the patch that introduce this regression
claims "Sending the whole object out can cause a leak". Which isn't
very likely as this is a compat layer, where the data we are parsing
is generated by us and we know the string to be NULL terminated. But
you can of course never be to secure.

Fixes: 1baa4c9b8c6a (tipc: fix an infoleak in tipc_nl_compat_link_dump)
Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/netlink_compat.c