gnrc_icmpv6_echo: avoid crashing when pktbuf full#10869
gnrc_icmpv6_echo: avoid crashing when pktbuf full#10869miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
Once the packet buffer is full on heavy network load, gnrc_netif_hdr_build may return NULL. In that case, the following unchecked access to hdr->data leads to a crash.
|
With for _ in $(seq 10); do sudo ping6 fe80::b41f:ceff:febe:78d3%tapbr0 -s1452 -i0 -c 100000 & doneor for _ in $(seq 10); do sudo ping6 fe80::b41f:ceff:febe:78d3%tapbr0 -s1452 -f -c 100000 & donemostly without problems). So I can't really test. However |
|
Please provide a backport to the 2019.01-branch (You can use the script in #8968 for that if you want to). |
When bombarding in 4 terminals, it crashes with Where can I find the core file to take a look why it crashed? |
I had the same question for a while. On systemd systems, it is probably in |
I usually compile native with |
Thanks. I'm using UNIX/Linux since 25 years, |
Contribution description
This PR fixes the unchecked access to
(gnrc_netif_hdr_t *)hdr->datawherehdris returned fromgnrc_netif_hdr_build. If packet buffer is full,gnrc_netif_hdr_buildmay returnNULL. The following unchecked access to the pointer can then lead to a crash.Testing procedure
Produce a lot of network traffic using ping command with maximum data size and an intervall of 0, if necessary from multiple terminals so that the packet buffer becomes full, e.g.
This test should not lead to a crash.
Issues/PRs references
Problem was found during testing PR #10862 and described in issue #10861.