Skip to content

{bp-18571} net/nat: g_nat_lock can be used recursively and nat_lock/unlock should be paired#18629

Merged
xiaoxiang781216 merged 2 commits into
apache:releases/12.13from
jerpelea:bp-18571
Mar 27, 2026
Merged

{bp-18571} net/nat: g_nat_lock can be used recursively and nat_lock/unlock should be paired#18629
xiaoxiang781216 merged 2 commits into
apache:releases/12.13from
jerpelea:bp-18571

Conversation

@jerpelea
Copy link
Copy Markdown
Contributor

Summary

case: when rndis receive a packet and this packet is going to be forwarded.

first lock happen when ipv4_dev_forward call ipv4_nat_outbound;
next lock is: ipv4_nat_outbound_entry_find --> nat_port_select --> tcp_selectport --> nat_port_inuse

Impact

RELEASE

Testing

CI

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>
@github-actions github-actions Bot added Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small labels Mar 27, 2026
@xiaoxiang781216 xiaoxiang781216 merged commit 6e061f0 into apache:releases/12.13 Mar 27, 2026
3 checks passed
@jerpelea jerpelea deleted the bp-18571 branch May 20, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Networking Effects networking subsystem Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants