]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tcp: beware of alignments in tcp_get_info()
authorEric Dumazet <edumazet@google.com>
Wed, 27 Jan 2016 18:52:43 +0000 (10:52 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:16 +0000 (15:45 -0700)
commitc4c700d832ae2d66c1a47821ec44554563175dff
treee3112a8fb4e5ba06c30022bdaa2d5a8a23dcf6e9
parent66ad9b86a00bd69597b504437a1d89d84fe6fc2a
tcp: beware of alignments in tcp_get_info()

Orabug: 23330938

[ Upstream commit ff5d749772018602c47509bdc0093ff72acd82ec ]

With some combinations of user provided flags in netlink command,
it is possible to call tcp_get_info() with a buffer that is not 8-bytes
aligned.

It does matter on some arches, so we need to use put_unaligned() to
store the u64 fields.

Current iproute2 package does not trigger this particular issue.

Fixes: 0df48c26d841 ("tcp: add tcpi_bytes_acked to tcp_info")
Fixes: 977cb0ecf82e ("tcp: add pacing_rate information into tcp_info")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 1987c92ad0381beab46a65f79827d650de533584)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
net/ipv4/tcp.c