gnrc_netif_pktq: protect against concurrent access #18153
Merged
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
The
_get_free_entry()
accesses a static buffer, so we must protect it from concurrent access to avoid corruption.Testing procedure
Run the
examples/gnrc_border_router
on e.g. anrf52840dk
with another node in the network, in my case anavr-rss2
which got the address2001:db8::fec2:3d00:0:bb1
.Now start two pings in parallel on your host machine:
On
master
this will crash & burn:With this patch we also run out of queue space, but we manage to recover when we stop the flood ping.
Issues/PRs references
partially fixes #17924, when doing a
sudo ping -f 2001:db8::fec2:3d00:0:bb1 -s 512
the upstream interface remains 'dead' for several seconds after the flood ping was stopped.