sctp: do not leak chunks that are sent to unconfirmed paths
Subsystems (3)
Marcelo Ricardo Leitner
maintainerPATCH 1/1 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.
--- net/sctp/outqueue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/sctp/outqueue.c +5 -1
@@ -978,8 +978,12 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp) (new_transport->state == SCTP_UNCONFIRMED) || (new_transport->state == SCTP_PF))) new_transport = asoc->peer.active_path; -if (new_transport->state ==SCTP_UNCONFIRMED ) +if (new_transport->state ==SCTP_UNCONFIRMED ) { +WARN_ONCE (1 ,"Atempt to send packet on unconfirmed path." ); +sctp_chunk_fail (chunk,0 ); +sctp_chunk_free (chunk);continue ; + }/* Change packets if necessary. */ if (new_transport != transport) {
Signature · 1 line
2.5.0
From: Marcelo Ricardo Leitner <[email protected]>
Date: Fri, 18 Mar 2016 18:39:19 -0300
Quoted 9 lines
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 <[email protected]>
Applied.