Kernel: Pass all user pointers as Userspace<T*> in syscalls - #26980
Open
Hendiadyoin1 wants to merge 1 commit into
Open
Kernel: Pass all user pointers as Userspace<T*> in syscalls#26980Hendiadyoin1 wants to merge 1 commit into
Hendiadyoin1 wants to merge 1 commit into
Conversation
Hendiadyoin1
force-pushed
the
Userspace-all-the-things
branch
2 times, most recently
from
August 28, 2026 09:52
9348113 to
da39e52
Compare
As the commit title suggests the main change is always passing the pointer arguments as Userspace<T*>. This commit also makes creations of Userspace pointers more explicit on the kernel side and handles all the fallout from those changes. These changes include: * Adding dereferenceability on the Userland side of Userspace<T*> * Adding const up conversion to Userspace<T*> * changing kernel/user copies to use the correct overloads * Adding/removing casts as necessary * Changing signatures as necessary And a bit more controversial: * Changing futex params to contain volatile pointers This was the easiest way of getting the correct types for the atomic operations in sys$futex. The Kernel APIs should likely change signature instead, as volatility and atomicity are two very different concepts in modern c++.
Member
|
Can you please split this up into smaller atomic commits? (Maybe not one per syscall though.) There also seem to be some smaller drive-by changes between purely mechanical changes. It would be nice if those could be separate commits as well. (I kind of liked that we didn't use too many fancy C++ features over the syscall border. But I guess it's worth the extra safety here.) |
Member
Why? Have a look at all the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As the commit title suggests the main change is always passing the pointer arguments as Userspace<T*>.
This commit also makes creations of Userspace pointers more explicit on the kernel side and handles all the fallout from those changes.
These changes include:
And a bit more controversial:
This was the easiest way of getting the correct types for the atomic operations in sys$futex. The Kernel APIs should likely change signature instead, as volatility and atomicity are two very different concepts in modern c++.