-
Notifications
You must be signed in to change notification settings - Fork 0
uaccess: Prepare for masked user access on powerpc #382
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
base: linus-master_base
Are you sure you want to change the base?
Conversation
|
Upstream branch: f824272 |
d782508 to
6099a4d
Compare
|
Upstream branch: e7c375b |
16e31bb to
ecc3624
Compare
6099a4d to
5121c4d
Compare
|
Upstream branch: e7c375b |
ecc3624 to
dc76a2e
Compare
5121c4d to
4458758
Compare
|
Upstream branch: 8b69055 |
dc76a2e to
71b1e21
Compare
4458758 to
6f43942
Compare
|
Upstream branch: fd95357 |
Following patch will add missing barrier_nospec() to copy_from_user_iter(). On some architecture like x86 it might degrade performance, which would be unfortunate as copy_from_user_iter() is a critical function. Convert copy_from_user_iter() to using masked user access on architecture that support it. This is similar to what was done for copy_from_user() by commit 0fc810a ("x86/uaccess: Avoid barrier_nospec() in 64-bit copy_from_user()") Signed-off-by: Christophe Leroy <[email protected]>
The results of "access_ok()" can be mis-speculated. The result is that you can end speculatively: if (access_ok(from, size)) // Right here For the same reason as done in copy_from_user() by commit 74e19ef ("uaccess: Add speculation barrier to copy_from_user()"), add a speculation barrier to copy_from_user_iter(). Signed-off-by: Christophe Leroy <[email protected]>
Replace the open coded implementation with the scoped user access guards. No functional change intended. Signed-off-by: Christophe Leroy <[email protected]>
…uired Properly use masked_user_read_access_begin() and masked_user_write_access_begin() instead of masked_user_access_begin() in order to match user_read_access_end() and user_write_access_end(). This is important for architectures like powerpc that enable separately user reads and user writes. That means masked_user_read_access_begin() is used when user memory is exclusively read during the window and masked_user_write_access_begin() is used when user memory is exclusively writen during the window. masked_user_access_begin() remains and is used when both reads and writes are performed during the open window. Each of them is expected to be terminated by the matching user_read_access_end(), user_write_access_end() and user_access_end(). Signed-off-by: Christophe Leroy <[email protected]>
71b1e21 to
c44819b
Compare
Pull request for series with
subject: uaccess: Prepare for masked user access on powerpc
version: 5
url: https://patchwork.kernel.org/project/linux-block/list/?series=1024396