Skip to content
Commit 7deabaa7 authored by Robert Lubos's avatar Robert Lubos Committed by Anas Nashif
Browse files

net: tcp: Fix possible double TCP context dereferencing



In case TCP connection is being closed from the TCP stack, due to for
instance retransmission timeout, the stack should also switch the TCP
state to CLOSED. Otherwise, there was a risk of dereferencing the TCP
context twice, for example if the application was in active socket
send(), and tried to reschedule data transmission.

Additionally, make sure that the TCP_CLOSED state handling is a no-op
state - otherwise, there is a risk that if packets keep incoming before
the application dereferences the TCP context on its side, TCP stack
will incorrectly dereference the context for the second time from
within due to current TCP_CLOSED state logic.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent a84ecc2f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment