-
Notifications
You must be signed in to change notification settings - Fork 65
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
sock_ctrl_msg: mark recv_with_fds as unsafe #135
Merged
Merged
Conversation
This file contains 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
alyssais
requested review from
andreeaflorescu,
jiangliu and
sameo
as code owners
August 12, 2021 08:13
jiangliu
previously approved these changes
Aug 12, 2021
alyssais
force-pushed
the
sock_ctrl_msg
branch
2 times, most recently
from
August 13, 2021 07:39
15dcd44
to
9db7a27
Compare
jiangliu
previously approved these changes
Aug 13, 2021
Do I need to add tests to get the coverage up like the CI says, even though line count has just increased because of reformatting? |
Only meaningful test cases are really needed, and for this case we could decrease the coverage:) |
Writes to arbitrary pointers are unsafe in Rust. It's the caller's job to ensure that it's safe for the memory they are writing to can contain whatever arbitrary bytes are received over the socket. For example, it would be unsafe to have an iovec pointing to the return value of str::as_mut_ptr, because strings can only contain byte sequences that are valid UTF-8. Because it's on the caller to make sure they're passing pointers safely, any function that writes to iovecs has to be marked as unsafe. Signed-off-by: Alyssa Ross <hi@alyssa.is>
alyssais
force-pushed
the
sock_ctrl_msg
branch
from
August 13, 2021 16:39
9db7a27
to
cfb7635
Compare
I've rebased this in the hope that e39373f will fix the coverage issue. |
jiangliu
approved these changes
Aug 15, 2021
lauralt
approved these changes
Aug 19, 2021
slp
added a commit
to slp/vhost-user-backend
that referenced
this pull request
Sep 23, 2021
In addition to bringing the features from the new vhost crate, this fixes the breakage caused by rust-vmm/vmm-sys-util#135 Signed-off-by: Sergio Lopez <slp@redhat.com>
jiangliu
pushed a commit
to rust-vmm/vhost-user-backend
that referenced
this pull request
Sep 23, 2021
In addition to bringing the features from the new vhost crate, this fixes the breakage caused by rust-vmm/vmm-sys-util#135 Signed-off-by: Sergio Lopez <slp@redhat.com>
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.
Writes to arbitrary pointers are unsafe in Rust. It's the caller's job to ensure that it's safe for the memory they are writing to can contain whatever arbitrary bytes are received over the socket. For example, it would be unsafe to have an
iovec
pointing to the return value ofstr::as_mut_ptr
, because strings can only contain byte sequences that are valid UTF-8.Because it's on the caller to make sure they're passing pointers safely, any function that writes to
iovec
s has to be marked as unsafe.Signed-off-by: Alyssa Ross hi@alyssa.is
Corresponding vhost change: rust-vmm/vhost#69