Checking validity of user-space pointers in kernel land
@jaybosamiya-ms is already working on this.
Since Aug 22, 2025.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 144
- Avg merge
- 12h 21m
- Merged PRs (30d)
- 146
Description
[...] checking whether it is a valid user-space address is mildly out of scope of this particular functionality though, and should be checked at the shim layer before it is made into a
RawMutPointer. I think it is an orthogonal concern where we should probably set up better constraints on what is ok to be aRawMutPointer(i.e., if we made sure that every place that converts something to aRawMutPointerdoes it only for valid pointers, returning-EFAULTASAP) then we would not need to worry about such things in the guts of wherever we are dealing with this. Specifically, I think this is better handled by updatingfrom_usize: https://github.com/microsoft/litebox/blob/bd48201a2c0d01cd5a007e141ff1cf4a1e9467e7/litebox/src/platform/mod.rs#L368-L373
Originally posted by @jaybosamiya-ms in https://github.com/microsoft/litebox/pull/280#discussion_r2294714075
I think tweaking the from_usize would help fix the concerns such that no other part of the codebase then needs to worry about whether the pointer is valid or not.
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.
Assessment
This issue has not been assessed yet.