microsoft / microsoft/litebox

Checking validity of user-space pointers in kernel land

Open
#283 0 comments 0 reactions 1 assignee View on GitHub

@jaybosamiya-ms is already working on this.

Since Aug 22, 2025.

discussion enhancement layer-litebox
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 a RawMutPointer (i.e., if we made sure that every place that converts something to a RawMutPointer does it only for valid pointers, returning -EFAULT ASAP) 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 updating from_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.