]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerJiri Slaby <jslaby@suse.cz>
Thu, 9 Apr 2015 11:13:44 +0000 (13:13 +0200)
commitda65a31af4234826c6b840bbc2c451dd37fc9969
tree08707735964bd2f8a32c4347724ac53efbe726c7
parent4ac02a11486acbceef7c02bc6796393f45af53ca
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: Jiri Slaby <jslaby@suse.cz>
net/ipv4/inet_diag.c