kernel-module: scrub forwarded skb metadata#2140
Open
idanfreiberg wants to merge 1 commit into
Open
Conversation
gavriel-w
approved these changes
Jul 15, 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
Problem
The kernel module reuses an skb received from the network when constructing a rewritten proxy output packet. The per-family output paths clear selected fields, but the skb can still carry ingress routing, conntrack, skb extension, and netfilter metadata.
When the rewritten packet enters the local output path, that inherited state can cause it to be treated as part of the original ingress flow and routed back through an RTPengine target. The packet can then be processed repeatedly instead of being emitted once.
Fix
Call
skb_scrub_packet(skb, true)at the sharedsend_proxy_packet()boundary, where the ingress skb changes roles into a newly generated egress packet. The existing queue mapping reset remains necessary becauseskb_scrub_packet()deliberately does not clear that field.Verification
nft_rtpengine.kofrom this branch against Linux 5.15, 6.8, and 6.18 headers