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

sys/net/gnrc_pktbuf: detect use after free if canary is in metadata #21000

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

benpicco
Copy link
Contributor

Contribution description

When debugging #20983 this was quite useful to find the issue where a pointer to a pktsnip that was already freed was being held.

For the !CONFIG_GNRC_PKTBUF_CHECK_USE_AFTER_FREE this is already caught by the assert(pkt->users > 0), so if we turn on more extensive leak detection, don't degrade this case.

Testing procedure

Issues/PRs references

@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Nov 18, 2024
@benpicco benpicco requested a review from maribu November 18, 2024 12:30
@benpicco benpicco added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Nov 18, 2024
@maribu maribu enabled auto-merge November 18, 2024 12:41
@riot-ci
Copy link

riot-ci commented Nov 18, 2024

Murdock results

✔️ PASSED

83f5b26 sys/net/gnrc_pktbuf: detect use after free if canary is in metadata

Success Failures Total Runtime
10247 0 10249 16m:16s

Artifacts

@benpicco benpicco force-pushed the gnrc_pktbuf-use_after_free branch from 225c414 to 0cdbc62 Compare November 18, 2024 16:05
@benpicco benpicco force-pushed the gnrc_pktbuf-use_after_free branch from 0cdbc62 to 83f5b26 Compare November 19, 2024 14:23
@maribu maribu added this pull request to the merge queue Nov 19, 2024
@maribu maribu removed this pull request from the merge queue due to a manual request Nov 19, 2024
@maribu maribu added this pull request to the merge queue Nov 19, 2024
Merged via the queue into RIOT-OS:master with commit b02b23f Nov 19, 2024
25 checks passed
@benpicco benpicco deleted the gnrc_pktbuf-use_after_free branch November 19, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants