{bp-18571} net/nat: g_nat_lock can be used recursively and nat_lock/unlock should be paired#18629
Merged
Merged
Conversation
case: when rndis receive a packet and this packet is going to be forwarded. 1. first lock happen when ipv4_dev_forward call ipv4_nat_outbound; 2. next lock is: ipv4_nat_outbound_entry_find --> nat_port_select --> tcp_selectport --> nat_port_inuse Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
If call nat_enable twice, there will be a miss "nat_unlock". Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
xiaoxiang781216
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
case: when rndis receive a packet and this packet is going to be forwarded.
Impact
RELEASE
Testing
CI