Skip to content
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_icmpv6_echo: avoid crashing when pktbuf full [backport 2019.01] #10874

Merged
merged 1 commit into from
Jan 26, 2019

Conversation

gschorcht
Copy link
Contributor

Backport of #10869

Contribution description

This PR fixes the unchecked access to (gnrc_netif_hdr_t *)hdr->data where hdr is returned from gnrc_netif_hdr_build. If packet buffer is full, gnrc_netif_hdr_build may return NULL. 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.

sudo ping6 fe80::5ecf:7fff:fe80:3f08 -Ieth0 -s1392 -i0

This test should not lead to a crash.

Issues/PRs references

Problem was found during testing PR #10862 and described in issue #10861.

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.
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking labels Jan 25, 2019
@gschorcht gschorcht requested a review from miri64 January 25, 2019 21:58
@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master labels Jan 26, 2019
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked and the changes are the same as in #10869.

ACK

@aabadie aabadie merged commit d2e1162 into RIOT-OS:2019.01-branch Jan 26, 2019
@gschorcht
Copy link
Contributor Author

@aabadie Thanks

@gschorcht gschorcht deleted the gnrc_icmpv6_echo_fix branch January 26, 2019 09:14
@aabadie aabadie added this to the Release 2019.01 milestone Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants