Skip to content

Commit 31b055e

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: do not leak chunks that are sent to unconfirmed paths
Currently, if a chunk is scheduled to be sent through a transport that is currently unconfirmed, it will be leaked as it is dequeued from outq and is not re-queued nor freed. As I'm not aware of any situation that may lead to this situation, I'm fixing this by freeing the chunk and also logging a trace so that we can fix the other bug if it ever happens. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 07b4d6a commit 31b055e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/sctp/outqueue.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,12 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
978978
(new_transport->state == SCTP_UNCONFIRMED) ||
979979
(new_transport->state == SCTP_PF)))
980980
new_transport = asoc->peer.active_path;
981-
if (new_transport->state == SCTP_UNCONFIRMED)
981+
if (new_transport->state == SCTP_UNCONFIRMED) {
982+
WARN_ONCE(1, "Atempt to send packet on unconfirmed path.");
983+
sctp_chunk_fail(chunk, 0);
984+
sctp_chunk_free(chunk);
982985
continue;
986+
}
983987

984988
/* Change packets if necessary. */
985989
if (new_transport != transport) {

0 commit comments

Comments
 (0)