]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: process duplicated strreset asoc request correctly
authorXin Long <lucien.xin@gmail.com>
Sat, 15 Apr 2017 14:00:29 +0000 (22:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Apr 2017 17:39:50 +0000 (13:39 -0400)
commite57cee0a5b85c37b1abee0016fe1271535c7099d
tree0f59585517a6666b758588f06c413f12b75c1f89
parent916a9bb9e3a035cffc95d4073a9bb6eaedd32a19
sctp: process duplicated strreset asoc request correctly

This patch is to fix the replay attack issue for strreset asoc requests.

When a duplicated strreset asoc request is received, reply it with bad
seqno if it's seqno < asoc->strreset_inseq - 2, and reply it with the
result saved in asoc if it's seqno >= asoc->strreset_inseq - 2.

But note that if the result saved in asoc is performed, the sender's next
tsn and receiver's next tsn for the response chunk should be set. It's
safe to get them from asoc. Because if it's changed, which means the peer
has received the response already, the new response with wrong tsn won't
be accepted by peer.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/stream.c