[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201009151003.17407.dreibh@iem.uni-due.de>
Date: Wed, 15 Sep 2010 10:03:11 +0200
From: Thomas Dreibholz <dreibh@....uni-due.de>
To: netdev@...r.kernel.org, linux-sctp@...r.kernel.org
Cc: Martin Becke <martin.becke@...-due.de>
Subject: [PATCH] net: SCTP NULL-pointer dereference problem description and fix
sctp_assoc_update_retran_path() in net/sctp/associola.c may dereference a
NULL-pointer when compiled with SCTP_DEBUG option: t will be NULL if there is
no usable path for retransmission. SCTP_DEBUG_PRINTK_IPADDR() makes an access
to t->ipaddr.v4.sin_port, without checking t before. t==NULL => oops.
The patch below against 2.6.36-rc4 (git repository) simply ensures that t is
checked for not being set to NULL before calling SCTP_DEBUG_PRINTK_IPADDR().
Signed-off-by: Thomas Dreibholz <dreibh@....uni-due.de>
---
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index e41feff..b2688a4 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1321,15 +1321,15 @@ void sctp_assoc_update_retran_path(struct
sctp_association *asoc)
}
}
- if (t)
+ if (t) {
asoc->peer.retran_path = t;
-
- SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
- " %p addr: ",
- " port: %d\n",
- asoc,
- (&t->ipaddr),
- ntohs(t->ipaddr.v4.sin_port));
+ SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
+ " %p addr: ",
+ " port: %d\n",
+ asoc,
+ (&t->ipaddr),
+ ntohs(t->ipaddr.v4.sin_port));
+ }
}
/* Choose the transport for sending retransmit packet. */
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists