Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: shell: Prevent deadlock with net arp command #66518

Merged

Conversation

rlubos
Copy link
Contributor

@rlubos rlubos commented Dec 14, 2023

In case one of the networking shell backends is enabled, net arp command could potentially trigger a deadlock, as it locks the ARP mutex before TCP connection mutex, while TCP stack could do this in reverse order (for instance when sending ACK or retransmission).

Mitigate this, by forcing a separate TX thread in such case, so that ARP mutex is no longer accessed with TCP mutex locked.

The PR is an outcome of a discussion in #66287 (comment)

In case one of the networking shell backends is enabled, net arp command
could potentially trigger a deadlock, as it locks the ARP mutex before
TCP connection mutex, while TCP stack could do this in reverse order
(for instance when sending ACK or retransmission).

Mitigate this, by forcing a separate TX thread in such case, so that ARP
mutex is no longer accessed with TCP mutex locked.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
@fabiobaltieri fabiobaltieri merged commit 0c09589 into zephyrproject-rtos:main Dec 15, 2023
22 checks passed
@rlubos rlubos deleted the net/fix-arp-shell-deadlock branch December 20, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants