inet_diag: fix possible overflow in inet_diag_dump_one_icsk()
authorEric Dumazet <edumazet@google.com>
Fri, 13 Mar 2015 16:49:59 +0000 (09:49 -0700)
committerSasha Levin <sasha.levin@oracle.com>
Tue, 24 Mar 2015 12:22:19 +0000 (08:22 -0400)
commite1f2092a94304bd8d9dbcdd12334ed8fac69161f
tree70f1199294b61957fe5274ab3963fab50fc61c50
parentb9befa43034703b27026ef3f26d1993ce97163ff
inet_diag: fix possible overflow in inet_diag_dump_one_icsk()

[ Upstream commit c8e2c80d7ec00d020320f905822bf49c5ad85250 ]

inet_diag_dump_one_icsk() allocates too small skb.

Add inet_sk_attr_size() helper right before inet_sk_diag_fill()
so that it can be updated if/when new attributes are added.

iproute2/ss currently does not use this dump_one() interface,
this might explain nobody noticed this problem yet.

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>
net/ipv4/inet_diag.c