gnrc_netif_pktq: protect against concurrent access#18153
gnrc_netif_pktq: protect against concurrent access#18153miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
22b4b53 to
51cb364
Compare
miri64
left a comment
There was a problem hiding this comment.
The mutex should be initialized, otherwise, the change looks good.
51cb364 to
61cc168
Compare
|
btw: What's the reason this pool is not shared with the packet queue for address resolution ( |
|
I trust your testing and from the code this should also work fine. |
Changing your mind? #17680 (comment) ;-) |
|
I think it's different though. Unlike cache entries, those queue entries are short lived, when they are full we will lose packets either way. And if we queue the packet because we have to do address resolution first or because the interface is busy doesn't seem like much of a difference conceptually. If we have many packets queued for address resolution we would also have a busy interface as a result, and if our interface is too busy it would also drop the address resolution packets. |
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_routeron e.g. anrf52840dkwith another node in the network, in my case anavr-rss2which got the address2001:db8::fec2:3d00:0:bb1.Now start two pings in parallel on your host machine:
On
masterthis 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 512the upstream interface remains 'dead' for several seconds after the flood ping was stopped.