-
Notifications
You must be signed in to change notification settings - Fork 137
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
fix(model_specific): make {Fs,Gs,KernelGs}Base::write()
unsafe
#528
Conversation
I am not familiar with Ah, this should target |
d2ef402
to
1ed3a36
Compare
I'm not completely sure about this one. Writing to
Yes |
src/registers/model_specific.rs
Outdated
/// The caller must ensure that this write operation has no unsafe side | ||
/// effects, as the segment base address might be in use. |
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.
/// The caller must ensure that this write operation has no unsafe side | |
/// effects, as the segment base address might be in use. | |
/// The caller must ensure that this write operation has no unsafe side | |
/// effects, as the segment base address might be in use. |
As mentioned in my previous comment, the KernelGsBase
register is not the same as the base of the GS
registers, so it cannot be "in use".
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.
Ah, that's what you meant. I changed it to “The caller must ensure that a future call to GS::swap
has no unsafe side effects.”
Are you fine with that wording, or would you prefer a different wording?
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 can't come up with anything better of the top of my head. My impression is that the safety implications are closely tied to how a user actually uses KernelGsBase
, so it's hard to provide generic guidelines and this is probably the best we can do.
Ah, yes, I remember. Sounds good to me. 👍 |
1ed3a36
to
5807c5c
Compare
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.
Looks good to me, thanks! 🎄
This makes
FsBase::write()
,GsBase::write()
, andKernelGsBase::write()
unsafe and applies the safety doc comment fromSegment64::write_base()
.Closes #526.