Properly implement UserSpacePtr #102
Labels
project-kernel
Related to the kernel
safety
Something is unsound, could be unsafe
todo 🗒️
Created by the todo bot
type-bug
Something isn't working
Milestone
UserSpacePtr right now is just a glorified, horribly unsafe reference. We should change its interface to provide a lot more safety. It should have a get function returning a Result<T, UserspaceError> that copies the underlying type, returning an error if the underlying pointer is invalid (at least if it points to kernel memory. Maybe also if it is not mapped?).
We also have to handle unsized types. Maybe have a get_ref() which returns a &T? Maybe don't allow unsized types? I should check how Horizon/NX deals with it in sendsyncrequest (that's the only place that allows huge data afaik)
https://github.com/roblabla42/KFS/blob/adee47274ba5c0dc0ef112ce8933becd63d3da77/kernel/src/mem.rs#L199-L209
This issue was generated by todo based on a
TODO
comment in adee472 when #90 was merged. cc @roblabla.The text was updated successfully, but these errors were encountered: