Skip to content

[Backport v4.3-branch] mailbox: userspace: Fixes for mbox_send#110656

Open
github-actions[bot] wants to merge 2 commits into
v4.3-branchfrom
backport-109946-to-v4.3-branch
Open

[Backport v4.3-branch] mailbox: userspace: Fixes for mbox_send#110656
github-actions[bot] wants to merge 2 commits into
v4.3-branchfrom
backport-109946-to-v4.3-branch

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Backport ab35eac~2..ab35eac from #109946.

Original PR description:


Two fixes for mbox_send when userspace is enabled:

  • Fix msg == NULL, since it is valid per API documentation
  • Fix TOCTOU copying the msg to kernel memory

For more specific details look commit messages.

ceolin added 2 commits June 5, 2026 19:26
handle msg == NULL explicitly since it is valid according with
the API documentation.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
(cherry picked from commit d858a79)
The syscall verifier validated msg->data directly from live userspace
memory and then forwarded the original mutable userspace struct pointer
to z_impl_mbox_send(). A concurrent thread could race msg->data to a
supervisor address after the access check.

Fix this by copying struct mbox_msg into a kernel-stack variable.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
(cherry picked from commit ab35eac)
@github-actions github-actions Bot added the Backport Backport PR and backport failure issues label Jun 5, 2026
@github-project-automation github-project-automation Bot moved this to To do in Backports Jun 5, 2026
@dkalowsk dkalowsk added this to the v4.3.1 milestone Jun 9, 2026
@jhedberg jhedberg moved this from To do to Needs a bug report in Backports Jun 9, 2026
@jhedberg jhedberg closed this Jun 9, 2026
@github-project-automation github-project-automation Bot moved this from Needs a bug report to Done in Backports Jun 9, 2026
@jhedberg jhedberg reopened this Jun 9, 2026
@github-project-automation github-project-automation Bot moved this from Done to Needs more info in Backports Jun 9, 2026
@zephyrbot zephyrbot requested a review from ithinuel June 9, 2026 16:32
@jhedberg jhedberg moved this from Needs more info to Needs a bug report in Backports Jun 9, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@cfriedt

cfriedt commented Jun 10, 2026

Copy link
Copy Markdown
Member

@ceolin - can you please create an issue for the backport?

@jhedberg jhedberg modified the milestones: v4.3.1, v4.3.2 Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mbox Backport Backport PR and backport failure issues

Projects

Status: Needs a bug report

Development

Successfully merging this pull request may close these issues.

5 participants