oxidecomputer / oxidecomputer/hubris
Consider making `read_task_dump_region` KIPC fallible
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 239
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
Right now, the read_task_dump_region KIPC will fault a task if that task requests an invalid read (e.g. reading memory that's not owned by the task we claim it is).
In jefe, we use read_task_dump_region when dumping other tasks (to get their memory). We do not want jefe to get faulted, and it may be asked to dump an arbitrary region (over IPC), so we also have to check whether the dump region is valid (using the get_task_desc_region and get_task_dump_region KIPCs).
This means that we have duplicate code in jefe and the kernel, which compares an address range to a task's dump regions to decide if it's fully covered. Having this code in two places isn't ideal: #1674 fixed the kernel issue when a range spanned multiple contiguous MPU regions, but we didn't fix it in jefe until #2485 (when it was revealed by multi-region RAM packing in #2458).
We could instead make read_task_dump_region a fallible KIPC, then remove the preflight checks in jefe.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the read_task_dump_region KIPC in the kernel and the corresponding preflight checks in jefe, including the get_task_desc_region and get_task_dump_region KIPCs. Make the read operation report invalid ranges instead of faulting its caller, then remove the duplicate validation in jefe and verify that arbitrary and multi-region dump requests are handled safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- embedded-iot, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100