Skip to content

erts: Set recvmmsg data length to the receive buffer size - #11335

Merged
RaimoNiskanen merged 1 commit into
erlang:maintfrom
garazdawi:lukas/erts/fix-recvmmsg
Jul 6, 2026
Merged

erts: Set recvmmsg data length to the receive buffer size#11335
RaimoNiskanen merged 1 commit into
erlang:maintfrom
garazdawi:lukas/erts/fix-recvmmsg

Conversation

@garazdawi

Copy link
Copy Markdown
Member

In essio_recvmmsg, msg_len is used both to copy the received data out of the shared receive buffer and to size the result binary. With MSG_TRUNC the kernel reports the untruncated datagram length in msg_len even though only buffer-size bytes were actually stored, so using it unset copies past the buffer (heap-buffer-overflow) and sizes a binary larger than its allocation.

In essio_recvmmsg, msg_len is used both to copy the received data out of
the shared receive buffer and to size the result binary. With MSG_TRUNC
the kernel reports the untruncated datagram length in msg_len even though
only buffer-size bytes were actually stored, so using it unset copies
past the buffer (heap-buffer-overflow) and sizes a binary larger than its
allocation.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    4 files    199 suites   1h 54m 41s ⏱️
3 369 tests 2 896 ✅ 472 💤 1 ❌
4 270 runs  3 720 ✅ 549 💤 1 ❌

For more details on these failures, see this check.

Results for commit 5536c58.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@RaimoNiskanen RaimoNiskanen self-assigned this Jul 3, 2026
@RaimoNiskanen
RaimoNiskanen self-requested a review July 3, 2026 14:25
@RaimoNiskanen RaimoNiskanen added this to the OTP-29.1 milestone Jul 3, 2026
@RaimoNiskanen RaimoNiskanen added the testing currently being tested, tag is used by OTP internal CI label Jul 3, 2026

@RaimoNiskanen RaimoNiskanen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me

@RaimoNiskanen
RaimoNiskanen merged commit d402614 into erlang:maint Jul 6, 2026
33 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix in progress priority:medium team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants