OSDN Git Service

sctp: fix the issue that the cookie-ack with auth can't get processed
authorXin Long <lucien.xin@gmail.com>
Wed, 2 May 2018 05:45:12 +0000 (13:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 May 2018 08:26:59 +0000 (10:26 +0200)
commitdb869e7dd670f2991030b226d44e5de3a82987b1
tree2f65716f6e3588bd03cf14a8c6a52aff84fb2d82
parent832978fced8c531ac2366c04a7d5a1124a631b0d
sctp: fix the issue that the cookie-ack with auth can't get processed

[ Upstream commit ce402f044e4e432c296f90eaabb8dbe8f3624391 ]

When auth is enabled for cookie-ack chunk, in sctp_inq_pop, sctp
processes auth chunk first, then continues to the next chunk in
this packet if chunk_end + chunk_hdr size < skb_tail_pointer().
Otherwise, it will go to the next packet or discard this chunk.

However, it missed the fact that cookie-ack chunk's size is equal
to chunk_hdr size, which couldn't match that check, and thus this
chunk would not get processed.

This patch fixes it by changing the check to chunk_end + chunk_hdr
size <= skb_tail_pointer().

Fixes: 26b87c788100 ("net: sctp: fix remote memory pressure from excessive queueing")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sctp/inqueue.c