]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: return sizeof tcp_dctcp_info in dctcp_get_info()
authorNeal Cardwell <ncardwell@google.com>
Mon, 13 Jun 2016 15:20:35 +0000 (11:20 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jun 2016 06:46:30 +0000 (23:46 -0700)
commit3c421e5d991df8c862217b1783a090dd391871c9
tree80f977432d9fc7d290e5a72416dbca84ec9464e6
parent23d6f303c2dc16f29de3f2a96294a2b362124d58
tcp: return sizeof tcp_dctcp_info in dctcp_get_info()

Make sure that dctcp_get_info() returns only the size of the
info->dctcp struct that it zeroes out and fills in. Previously it had
been returning the size of the enclosing tcp_cc_info union,
sizeof(*info).  There is no problem yet, but that union that may one
day be larger than struct tcp_dctcp_info, in which case the
TCP_CC_INFO code might accidentally copy uninitialized bytes from the
stack.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_dctcp.c