-
Notifications
You must be signed in to change notification settings - Fork 69
Rename __USER_CAP* and *copy{in,out}cap* #2494
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
Open
brooksdavis
wants to merge
5
commits into
dev
Choose a base branch
from
cap2ptr
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,073
−1,021
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
767d146
ipf: copy{in,out}ptr -> copy{in,out}_indirect
brooksdavis e9aeeb8
sys: __USER_CAP -> USER_PTR
brooksdavis 0504423
sys: copy{in,out}cap -> copy{in,out}ptr
brooksdavis 89e6515
copy(9): document copy{in,out}ptr*
brooksdavis 5b8e32a
socket(9): document sooptcopy{in,out}ptr
brooksdavis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,15 +32,19 @@ | |||||
| .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||||
| .\" SUCH DAMAGE. | ||||||
| .\" | ||||||
| .Dd May 11, 2020 | ||||||
| .Dd December 9, 2025 | ||||||
| .Dt COPY 9 | ||||||
| .Os | ||||||
| .Sh NAME | ||||||
| .Nm copy , | ||||||
| .Nm copyin , | ||||||
| .Nm copyin_nofault , | ||||||
| .Nm copyinptr , | ||||||
| .Nm copyinptr_nofault , | ||||||
| .Nm copyout , | ||||||
| .Nm copyout_nofault , | ||||||
| .Nm copyoutptr , | ||||||
| .Nm copyoutptr_nofault , | ||||||
| .Nm copystr , | ||||||
| .Nm copyinstr | ||||||
| .Nd heterogenous address space copy functions | ||||||
|
|
@@ -52,9 +56,17 @@ | |||||
| .Ft int | ||||||
| .Fn copyin_nofault "const void *uaddr" "void *kaddr" "size_t len" | ||||||
| .Ft int | ||||||
| .Fn copyinptr "const void *uaddr" "void *kaddr" "size_t len" | ||||||
| .Ft int | ||||||
| .Fn copyinptr_nofault "const void *uaddr" "void *kaddr" "size_t len" | ||||||
| .Ft int | ||||||
| .Fn copyout "const void *kaddr" "void *uaddr" "size_t len" | ||||||
| .Ft int | ||||||
| .Fn copyout_nofault "const void *kaddr" "void *uaddr" "size_t len" | ||||||
| .Ft int | ||||||
| .Fn copyoutptr "const void *kaddr" "void *uaddr" "size_t len" | ||||||
| .Ft int | ||||||
| .Fn copyoutptr_nofault "const void *kaddr" "void *uaddr" "size_t len" | ||||||
| .Ft int __deprecated | ||||||
| .Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done" | ||||||
| .Ft int | ||||||
|
|
@@ -80,7 +92,14 @@ functions copy | |||||
| bytes of data from the user-space address | ||||||
| .Fa uaddr | ||||||
| to the kernel-space address | ||||||
| .Fa kaddr . | ||||||
| .Fa kaddr | ||||||
| without preserving pointer provenance. | ||||||
| The | ||||||
| .Fn copyinptr | ||||||
| and | ||||||
| .Fn copyinptr_nofault | ||||||
| functions do the same, | ||||||
| but preserve the provenance of copied pointers. | ||||||
| .Pp | ||||||
| The | ||||||
| .Fn copyout | ||||||
|
|
@@ -91,7 +110,14 @@ functions copy | |||||
| bytes of data from the kernel-space address | ||||||
| .Fa kaddr | ||||||
| to the user-space address | ||||||
| .Fa uaddr . | ||||||
| .Fa uaddr | ||||||
| without perservice pointer provenance. | ||||||
| The | ||||||
| .Fn copyoutptr | ||||||
| and | ||||||
| .Fn copyoutptr_nofault | ||||||
| functions do the same, | ||||||
| but preserve the provenance of copied pointers. | ||||||
| .Pp | ||||||
| The | ||||||
| .Fn copyin_nofault | ||||||
|
|
@@ -104,6 +130,17 @@ read and write access, respectively, and neither the source nor | |||||
| destination addresses may be pageable. | ||||||
| .Pp | ||||||
| The | ||||||
| .Fn copyinptr , | ||||||
| .Fn copyinptr_nofault , | ||||||
| .Fn copyoutptr , | ||||||
| and | ||||||
| .Fn copyoutptr_nofault | ||||||
| functions must be used when copying data which may contain pointers and | ||||||
| they may be used anywhere, | ||||||
| but they should be used only when necessicary to limit the numeber of | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| code paths that could leak pointers. | ||||||
| .Pp | ||||||
| The | ||||||
| .Fn copystr | ||||||
| function copies a NUL-terminated string, at most | ||||||
| .Fa len | ||||||
|
|
||||||
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be tempted to drop "and they may be used anywhere", and just say "must be used when copying data which contains pointers, but they should only be used when necessary..."