gnrc_ipv6: fix SEGFAULT when multicasting with multiple interfaces#12512
Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom Oct 21, 2019
Merged
gnrc_ipv6: fix SEGFAULT when multicasting with multiple interfaces#12512miri64 merged 1 commit intoRIOT-OS:masterfrom
miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
miri64
commented
Oct 20, 2019
| /* need to get second write access (duplication) to fill IPv6 | ||
| * header interface-local */ | ||
| gnrc_pktsnip_t *tmp = gnrc_pktbuf_start_write(pkt); | ||
| send_pkt = gnrc_pktbuf_start_write(pkt); |
Member
Author
There was a problem hiding this comment.
I also renamed that variable because tmp was a bit unintuitive ;-)
benpicco
reviewed
Oct 20, 2019
When writing to the IPv6 header the implementation currently doesn't take the packet with the (potentially) duplicated header, but the packet with the original one, which leads to the packet sent and then released in `gnrc_netif_ethernet.c` first and then accessed again in further iterations of the "writing to the IPv6 header" loop, which causes access to an invalid pointer, causing a crash. Fixes RIOT-OS#11980
25a6782 to
ce14ee1
Compare
80 tasks
benpicco
approved these changes
Oct 20, 2019
Contributor
benpicco
left a comment
There was a problem hiding this comment.
Works as expected :)
Only tested it on native now, I can try it out on a device with two 802.15.4 interfaces tomorrow, but that shouldn't stall merging - if multi-interface multicast brings more bugs to the surface, that would be a separate issue.
This was referenced Oct 20, 2019
Member
Author
|
Thanks for reviewing and testing! |
Member
Author
|
Backport provided in #12521 |
Contributor
|
And for completeness' sake: |
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.
Contribution description
When writing to the IPv6 header the implementation currently doesn't take the packet with the (potentially) duplicated header, but the packet with the original one, which leads to the packet sent and then released in
gnrc_netif_ethernet.cfirst and then accessed again in further iterations of the "writing to the IPv6 header" loop, which causes access to an invalid pointer, causing a crash.Testing procedure
When repeating the "Steps to reproduce" in #11980, the node should not crash and you get a lot of (duplicate) replies. When using two interfaces with one being a 6LoWPAN interface, the node should not crash, pinging might however not work due to the bug fixed in #10499.
Issues/PRs references
Fixes #11980