-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnrc_ipv6: fix SEGFAULT when multicasting with multiple interfaces #12512
Conversation
if (prep_hdr) { | ||
DEBUG("ipv6: prepare IPv6 header for sending\n"); | ||
/* 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also renamed that variable because tmp
was a bit unintuitive ;-)
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Thanks for reviewing and testing! |
Backport provided in #12521 |
And for completeness' sake:
|
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.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.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