Skip to content

kernel: harden thread stack syscall verifiers - #4618

Open
bjarki-andreasen wants to merge 1 commit into
nrfconnect:ncs-v3.3-branchfrom
bjarki-andreasen:harden_thread_stack_syscall_verifiers_v3_3_branch
Open

bjarki-andreasen wants to merge 1 commit into
nrfconnect:ncs-v3.3-branchfrom
bjarki-andreasen:harden_thread_stack_syscall_verifiers_v3_3_branch

Conversation

@bjarki-andreasen

Copy link
Copy Markdown
Contributor

cherry pick of kernel: harden thread stack syscall verifiers

z_vrfy_k_thread_stack_space_get() consumed its K_SYSCALL_OBJ() result
with CHECKIF(), which is compiled out under CONFIG_NO_RUNTIME_CHECKS
and CONFIG_ASSERT_ON_ERRORS. Wrap it in K_OOPS() instead, leaving
CHECKIF() on the remaining error propagation.

dynamic_disabled.c had no verifiers for k_thread_stack_alloc() and
k_thread_stack_free(). Add pass-throughs; neither argument is
dereferenced there, and checking the stack object would replace the
documented -ENOSYS return.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5

(cherry picked from commit 02e50aa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backward-compatible A backwards compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants