Fix skb data corruption on broadcast across multiple interfaces#22
Open
TrevorGibson-SR wants to merge 1 commit into
Open
Conversation
Replace the skb_headroom() check with skb_cow_head(), which both ensures sufficient headroom and copies the shared data buffer into a private one when the skb is cloned
Member
|
Thanks for reporting this! I see the issue, and the fix looks correct. The fix will be merged through our BSP, and available in the next 06 release. Thanks. |
Author
|
Happy to help, thanks for integrating this! |
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.
I encountered this bug when attempting to send broadcast traffic on multiple vtss.vlan.x interfaces simultaneously.
The current driver implementation modifies the socket buffer when adding the IFH and VLAN tags. This method works fine when there's only one interface using the buffer, but breaks when shared across two or more interfaces (in my case, using a bridge interface to send out broadcast traffic on multiple vtss.vlan.x interfaces). The data in the socket buffer becomes corrupted for any subsequent calls to internal_dev_xmit() and prevents the packets from being delivered or responded to correctly.
The fix is to use skb_cow_head() to both ensure sufficient headroom and copy the buffer before pushing IFH and VLAN tags into it, instead of checking against and modifying the original buffer.