Skip to content
Commit f50c9e11 authored by Jukka Rissanen's avatar Jukka Rissanen Committed by Jukka Rissanen
Browse files

net: tcp2: Avoid deadlock when closing the connection



When a connection is being closed, it is possible that the application
will have a lock to net_context and TCP2 connection lock. If we then
receive a final TCP2 ACK and close the connection, the locking order
get switched and TCP2 will first try to get its own lock and then the
net_context lock. This will lead to deadlock as the locking ordering
is now mixed.

The solution is to unref the TCP connection after releasing the
connection lock. The TCP connection unref function will anyway get the
lock so no need to do double locking.

Fixes #29444

Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent 0d216924
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment