Skip to content

Commit ce402f0

Browse files
lxindavem330
authored andcommitted
sctp: fix the issue that the cookie-ack with auth can't get processed
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: 26b87c7 ("net: sctp: fix remote memory pressure from excessive queueing") Signed-off-by: Xin Long <[email protected]> Acked-by: Neil Horman <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 46e16d4 commit ce402f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sctp/inqueue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
217217
skb_pull(chunk->skb, sizeof(*ch));
218218
chunk->subh.v = NULL; /* Subheader is no longer valid. */
219219

220-
if (chunk->chunk_end + sizeof(*ch) < skb_tail_pointer(chunk->skb)) {
220+
if (chunk->chunk_end + sizeof(*ch) <= skb_tail_pointer(chunk->skb)) {
221221
/* This is not a singleton */
222222
chunk->singleton = 0;
223223
} else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {

0 commit comments

Comments
 (0)