[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20131229.222435.1179109367469102281.davem@davemloft.net>
Date: Sun, 29 Dec 2013 22:24:35 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: ying.xue@...driver.com
Cc: netdev@...r.kernel.org, jon.maloy@...csson.com,
Paul.Gortmaker@...driver.com, erik.hugne@...csson.com,
lars.everbrand@...csson.com, tipc-discussion@...ts.sourceforge.net
Subject: Re: [PATCH] tipc: fix deadlock during socket release
From: Ying Xue <ying.xue@...driver.com>
Date: Fri, 27 Dec 2013 10:18:28 +0800
> A deadlock might occur if name table is withdrawn in socket release
> routine, and while packets are still being received from bearer.
>
> CPU0 CPU1
> T0: recv_msg() release()
> T1: tipc_recv_msg() tipc_withdraw()
> T2: [grab node lock] [grab port lock]
> T3: tipc_link_wakeup_ports() tipc_nametbl_withdraw()
> T4: [grab port lock]* named_cluster_distribute()
> T5: wakeupdispatch() tipc_link_send()
> T6: [grab node lock]*
>
> The opposite order of holding port lock and node lock on above two
> different paths may result in a deadlock. If socket lock instead of
> port lock is used to protect port instance in tipc_withdraw(), the
> reverse order of holding port lock and node lock will be eliminated,
> as a result, the deadlock is killed as well.
>
> Reported-by: Lars Everbrand <lars.everbrand@...csson.com>
> Reviewed-by: Erik Hugne <erik.hugne@...csson.com>
> Signed-off-by: Ying Xue <ying.xue@...driver.com>
Applied, thanks.
--
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