]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: ulp: fix possible crash in tcp_diag_get_aux_size()
authorEric Dumazet <edumazet@google.com>
Thu, 5 Sep 2019 20:20:41 +0000 (13:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Sep 2019 15:32:28 +0000 (17:32 +0200)
commit53083d0158f2b1b9027a430a3b85c0f22021a80a
tree32d0dcfaa1ed927c724a286773a3e47317f9f780
parent280a7206b3f076c97dadad8d897f6a41e95be2e0
tcp: ulp: fix possible crash in tcp_diag_get_aux_size()

tcp_diag_get_aux_size() can be called with sockets in any state.

icsk_ulp_ops is only present for full sockets.

For SYN_RECV or TIME_WAIT ones we would access garbage.

Fixes: 7e41b9fc16a6 ("tcp: ulp: add functions to dump ulp-specific information")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Luke Hsiao <lukehsiao@google.com>
Reported-by: Neal Cardwell <ncardwell@google.com>
Cc: Davide Caratti <dcaratti@redhat.com>
Acked-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_diag.c