diff options
author | Xin Long <lucien.xin@gmail.com> | 2016-07-30 01:58:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-31 01:06:22 -0400 |
commit | 1aa25ec227a4be21515594f485b0f4985109f0d8 (patch) | |
tree | a5fedd47061bb248e731aae532c51dc8d6bacb22 /net | |
parent | f626300a3e776ccc9671b0dd94698fb3aa315966 (diff) |
sctp: fix the issue sctp requeue auth chunk incorrectly
sctp needs to queue auth chunk back when we know that we are going
to generate another segment. But commit f1533cce60d1 ("sctp: fix
panic when sending auth chunks") requeues the last chunk processed
which is probably not the auth chunk.
It causes panic when calculating the MAC in sctp_auth_calculate_hmac(),
as the incorrect offset of the auth chunk in skb->data.
This fix is to requeue it by using packet->auth.
Fixes: f1533cce60d1 ("sctp: fix panic when sending auth chunks")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/output.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c index 7425f6c23888..1f1682b9a6a8 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -610,7 +610,8 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp) | |||
610 | /* We will generate more packets, so re-queue | 610 | /* We will generate more packets, so re-queue |
611 | * auth chunk. | 611 | * auth chunk. |
612 | */ | 612 | */ |
613 | list_add(&chunk->list, &packet->chunk_list); | 613 | list_add(&packet->auth->list, |
614 | &packet->chunk_list); | ||
614 | } else { | 615 | } else { |
615 | sctp_chunk_free(packet->auth); | 616 | sctp_chunk_free(packet->auth); |
616 | packet->auth = NULL; | 617 | packet->auth = NULL; |