Move litebox::mm back to linux kernel platform
@CvvT is already working on this.
Since Mar 20, 2025.
- Dominant language
- Rust
- Stars
- 2.7k
- Forks
- 144
- Avg merge
- 12h 21m
- Merged PRs (30d)
- 146
Description
One issue I noticed when I was implementing syscall hooking was that intercepting `mmap` may lead to deadlock because our hook for `mmap` may also allocate objects on heap and thus cause infinite loop (allocator has lock so it is just deadlock). One solution is to replace the global allocator so that it knows how to call `mmap` "correctly" without causing deadlock.
After discussing it with @wdcui , it seems that we shouldn't intercept regular `mmap` (file-backed mapping still needs to be handled by litebox) because eventually the backend still calls `mmap`. What `PageManager` does is essentially managing all allocated memory, which is unnecessary for userland if we just forward all `mmap`, `munmap`, and `mprotect` to Linux. The only benefit is that we add an extra layer of defense.
We should probably move litebox::mm back to litebox_platform_linux_kernel.
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.