Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursivePageTable::map_to allows breaking memory safety #53

Closed
phil-opp opened this issue Jan 26, 2019 · 1 comment
Closed

RecursivePageTable::map_to allows breaking memory safety #53

phil-opp opened this issue Jan 26, 2019 · 1 comment

Comments

@phil-opp
Copy link
Member

The map_to method of the Mapper trait is not unsafe, but it is possible to break memory safety by passing a FrameAllocator that returns frames that are already in use.

To avoid this, we should either make the map_to method unsafe or make FrameAllocator an unsafe trait.

@phil-opp
Copy link
Member Author

I thought about this and found another way how map_to can break memory safety: Unmap a mapped page, then map that page to an already mapped frame. A write to this page then corrupts the other page that is mapped to the same frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant