Skip to contentSkip to conversation

sctp: fix oops when updating retransmit path with DEBUG on

PATCH Applied Wei Yongjun 2 participants 4 messages Apr 13, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sctp: fix oops when updating retransmit path with DEBUG on

From: Vlad Yasevich <[email protected]>

commit fbdf501c9374966a56829ecca3a7f25d2b49a305
sctp: Do no select unconfirmed transports for retransmissions

Introduced the initial falt.

commit d598b166ced20d9b9281ea3527c0e18405ddb803
sctp: Make sure we always return valid retransmit path

Solved the problem, but forgot to change the DEBUG statement. Thus it was still possible to dereference a NULL pointer.

---
 net/sctp/associola.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/sctp/associola.c +2 -0
index 0698cad..922fdd7 100644
@@ -1323,6 +1323,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
 
 	if (t)
 		asoc->peer.retran_path = t;
+	else
+		t = asoc->peer.retran_path;
 
 	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
 				 " %p addr: ",
Signature · 1 line
1.6.5.2
#1 lore raw

PATCH 1/1 sctp: fix oops while removed transport still using as retran path

Since we can not update retran path to unconfirmed transports, when we remove a peer, the retran path may not be update if the other transports are all unconfirmed, and we will still using the removed transport as the retran path. This may cause panic if retrasnmit happen.

---
 net/sctp/associola.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/sctp/associola.c +2 -0
index 922fdd7..1a21c57 100644
@@ -569,6 +569,8 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,
 		sctp_assoc_set_primary(asoc, transport);
 	if (asoc->peer.active_path == peer)
 		asoc->peer.active_path = transport;
+	if (asoc->peer.retran_path == peer)
+		asoc->peer.retran_path = transport;
 	if (asoc->peer.last_data_from == peer)
 		asoc->peer.last_data_from = transport;
 
Signature · 1 line
1.6.5.2
maintainer Applied
#2 lore raw

Re: [PATCH] sctp: fix oops while removed transport still using as retran path

From: Wei Yongjun <[email protected]>
Date: Wed, 13 Apr 2011 09:22:22 +0800

Quoted 7 lines

Since we can not update retran path to unconfirmed transports, when we remove a peer, the retran path may not be update if the other transports are all unconfirmed, and we will still using the removed transport as the retran path. This may cause panic if retrasnmit happen.

Applied.

maintainer Applied
#3 lore raw
In reply to Wei Yongjun

From: Wei Yongjun <[email protected]>
Date: Wed, 13 Apr 2011 09:20:48 +0800

Quoted 7 lines

From: Vlad Yasevich <[email protected]>

commit fbdf501c9374966a56829ecca3a7f25d2b49a305
sctp: Do no select unconfirmed transports for retransmissions

Introduced the initial falt.

Quoted 8 lines

commit d598b166ced20d9b9281ea3527c0e18405ddb803
sctp: Make sure we always return valid retransmit path

Solved the problem, but forgot to change the DEBUG statement. Thus it was still possible to dereference a NULL pointer.

Applied.