Message ID | 1409191361-28179-1-git-send-email-ying.xue@windriver.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Ying Xue <ying.xue@windriver.com> Date: Thu, 28 Aug 2014 10:02:41 +0800 > Commit 6c9808ce09f7 ("tipc: remove port_lock") accidentally involves > a potential bug: when tipc socket instance(tsk) is not got with given > reference number in tipc_sk_get(), tsk is set to NULL. Subsequently > we jump to exit label where to decrease socket reference counter > pointed by tsk pointer in tipc_sk_put(). However, As now tsk is NULL, > oops may happen because of touching a NULL pointer. > > Signed-off-by: Ying Xue <ying.xue@windriver.com> > Acked-by: Erik Hugne <erik.hugne@ericsson.com> > Acked-by: Jon Maloy <jon.maloy@ericsson.com> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index d416e83..75275c5 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2118,9 +2118,9 @@ static void tipc_sk_timeout(unsigned long ref) tsk = tipc_sk_get(ref); if (!tsk) - goto exit; - sk = &tsk->sk; + return; + sk = &tsk->sk; bh_lock_sock(sk); if (!tsk->connected) { bh_unlock_sock(sk);