Documented how the Module Manager authenticates the kernel objects a module names - #51
Open
fdesbiens wants to merge 1 commit into
Open
Conversation
…module names The pointer validation section described how a port answers for a range of memory, which is the right answer to the question a buffer poses and not an answer to the question a kernel object poses. A range check establishes that privileged code may touch some memory; it cannot establish that the memory is the object the service was asked to operate on. For an object that is the question that matters, because the object pool lies outside every module, so an address pointing into the middle of a module's own privileged allocation is outside the module and would satisfy a range check while denoting no object at all. A new subsection states the rule objects are actually held to: the address must be the exact address of a live object of the type the service expects, answered from the kernel's created list for that type, with an address inside an object, an allocation not yet created, a deleted object and a mismatched type all refused, and a type never taken from the object itself. It records that the same rule is what lets an application-owned object be shared with a module and why no separate registration is needed, that identity and type are settled but authorisation is not, and what the check costs. It also records the two service behaviours that follow: tx_thread_reset refuses a thread that is not a module thread, and object deallocation clears the control block ID of the memory it gives back. Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation for the Module Manager change that accompanies a private security advisory. The code change is under separate review.
Why
The "Module Manager pointer validation" section describes how a port answers for a range of memory. That is the right answer to the question a buffer poses, and not an answer to the question a kernel object poses: a range check establishes that privileged code may touch some memory, not that the memory is the object the service was asked to operate on.
For a kernel object that distinction is the whole point. The Module Manager's object pool lies outside every module, so an address pointing into the middle of one of a module's own privileged allocations is outside the module and satisfies a range check while denoting no object at all — and the bytes it presents as a control block, ID included, are bytes the module placed there through ordinary create and set services.
What this adds
A "Kernel object validation" subsection stating the rule objects are held to:
It also records:
TXM_MODULE_MEMORY_PROTECTION;tx_thread_resetreturnsTX_NOT_DONEfor a thread that is not a module thread, andtxm_module_object_deallocateclears the control block ID of the memory it gives back.Verification
Built with Antora and the rendered
threadx-moduleschapter 3 page checked: the new subsection appears in place before "Cortex-A7 MMU ports", and the API names render as intended.