summaryrefslogtreecommitdiff
path: root/include/uapi/linux/psample.h
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2021-05-03 04:41:20 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-19 10:13:06 +0200
commitdb5f1c6f776d7f02e490ba2943d388a0b6140949 (patch)
tree89f42d2457b3b287b8715fda603047008a3f6c84 /include/uapi/linux/psample.h
parent7afdd6aba95c8a526038e7abe283eeac3e4320f1 (diff)
sctp: fix a SCTP_MIB_CURRESTAB leak in sctp_sf_do_dupcook_b
[ Upstream commit f282df0391267fb2b263da1cc3233aa6fb81defc ] Normally SCTP_MIB_CURRESTAB is always incremented once asoc enter into ESTABLISHED from the state < ESTABLISHED and decremented when the asoc is being deleted. However, in sctp_sf_do_dupcook_b(), the asoc's state can be changed to ESTABLISHED from the state >= ESTABLISHED where it shouldn't increment SCTP_MIB_CURRESTAB. Otherwise, one asoc may increment MIB_CURRESTAB multiple times but only decrement once at the end. I was able to reproduce it by using scapy to do the 4-way shakehands, after that I replayed the COOKIE-ECHO chunk with 'peer_vtag' field changed to different values, and SCTP_MIB_CURRESTAB was incremented multiple times and never went back to 0 even when the asoc was freed. This patch is to fix it by only incrementing SCTP_MIB_CURRESTAB when the state < ESTABLISHED in sctp_sf_do_dupcook_b(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/uapi/linux/psample.h')
0 files changed, 0 insertions, 0 deletions