Usercopy migration
Big MR: replaces the use of validate_*
functions, and the use of Rust refs/slices pointing to user memory, with UserSlice
. Hence, EFAULT is handled lazily if the kernel page faults inside the inner usercopy function.
It also makes UserScheme
use the syscall_head/syscall_tail buffers, and allows identical contiguous grants to be merged (thus forcing physunmap to be removed) not yet.
Last but not least, it enables UMIP+SMEP+SMAP if supported by the CPU. SMAP can be disabled in Cargo.toml.
Requires syscall!74 (merged) and drivers!93 (merged).
Also fixes error-code page fault handlers on x86_32. All three supported platforms are also supported in this MR, although I'm unsure if the aarch64 code is formally correct.
Fixes #82 (closed) and #115 (closed).
Merge request reports
Activity
added 22 commits
-
13b51700...0ae3958a - 2 commits from branch
redox-os:master
- 0ae3958a...133b3ba4 - 10 earlier commits
- 805a12a3 - Fix warnings.
- 90953cec - Boot to desktop.
- 38df0b63 - Replace validate with UserSlice in syscall/mod.rs.
- 2090f08e - Use usercopy and physmem atomic load in futex().
- 133bf309 - Remove usermem validate functions.
- b722bc17 - Handle #PFs in usercopy fns, returning EFAULT.
- 8d3be772 - Enable UMIP, SMEP, and SMAP if available.
- 9c1547ce - Reimplement syscall debug.
- d5820ceb - Allow disabling SMAP via cargo.
- dbb005fc - Update syscall.
Toggle commit list-
13b51700...0ae3958a - 2 commits from branch
added 1 commit
- 8f1f055c - Handle EFAULT when copying back from head/tail.
added 1 commit
- 2988587a - Zero-out all head/tail bytes for write-only calls.
added 36 commits
-
b1cf4ca2...503a21d4 - 2 commits from branch
redox-os:master
- 503a21d4...30fd97f7 - 24 earlier commits
- 274e55e8 - Basic usercopy MMU fault handler for AArch64.
- b7e893b6 - Allow unaligned fmap again.
- b24a3dc5 - Update syscall.
- ced759e3 - Handle EFAULT when copying back from head/tail.
- cd47ac34 - Fix sys: kread handler.
- a9fd45b0 - Warn if fmap is called with unaligned size.
- 9b44ddd4 - Reset RFLAGS.AC in EFAULT handler.
- 7b951157 - Do not continue stack-tracing userspace addresses.
- bab3cfbb - Zero-out all head/tail bytes for write-only calls.
- 3b0bae05 - Set RFLAGS.AC in debugger::debugger.
Toggle commit list-
b1cf4ca2...503a21d4 - 2 commits from branch
added 35 commits
-
28495108 - 1 commit from branch
redox-os:master
- 28495108...decb935f - 24 earlier commits
- 736e1835 - Basic usercopy MMU fault handler for AArch64.
- 399b81a3 - Allow unaligned fmap again.
- bde1ee4f - Update syscall.
- 6c5c66fe - Handle EFAULT when copying back from head/tail.
- 17d5c2ba - Fix sys: kread handler.
- 78b55c88 - Warn if fmap is called with unaligned size.
- 096a6658 - Reset RFLAGS.AC in EFAULT handler.
- dabb1e75 - Do not continue stack-tracing userspace addresses.
- 9a2ce672 - Zero-out all head/tail bytes for write-only calls.
- 97410954 - Set RFLAGS.AC in debugger::debugger.
Toggle commit list-
28495108 - 1 commit from branch
added 36 commits
-
97410954...78a8173f - 2 commits from branch
redox-os:master
- 78a8173f...a12ebdf3 - 24 earlier commits
- ad3b17f5 - Basic usercopy MMU fault handler for AArch64.
- b958c70e - Allow unaligned fmap again.
- ac1b4f00 - Update syscall.
- cfdc1ab6 - Handle EFAULT when copying back from head/tail.
- 39fc6eb3 - Fix sys: kread handler.
- 46cd744b - Warn if fmap is called with unaligned size.
- 99a3c68c - Reset RFLAGS.AC in EFAULT handler.
- 9179b9cb - Do not continue stack-tracing userspace addresses.
- 3aedd131 - Zero-out all head/tail bytes for write-only calls.
- 8cc720b3 - Set RFLAGS.AC in debugger::debugger.
Toggle commit list-
97410954...78a8173f - 2 commits from branch
added 36 commits
-
8cc720b3...7269f9c6 - 2 commits from branch
redox-os:master
- 7269f9c6...3f461213 - 24 earlier commits
- 1c4d6e0d - Basic usercopy MMU fault handler for AArch64.
- a6d764b1 - Allow unaligned fmap again.
- 2bfea663 - Update syscall.
- 262a9d0c - Handle EFAULT when copying back from head/tail.
- 27a11e08 - Fix sys: kread handler.
- ba997d1f - Warn if fmap is called with unaligned size.
- 696e4806 - Reset RFLAGS.AC in EFAULT handler.
- d405e2c6 - Do not continue stack-tracing userspace addresses.
- 11f571cb - Zero-out all head/tail bytes for write-only calls.
- 8ac9f575 - Set RFLAGS.AC in debugger::debugger.
Toggle commit list-
8cc720b3...7269f9c6 - 2 commits from branch
added 1 commit
- 6cbc492c - Revert "Automatically merge adjacent grants."
added 41 commits
-
6cbc492c...acefb888 - 2 commits from branch
redox-os:master
- acefb888...4953d6ec - 29 earlier commits
- 9fcdb693 - Warn if fmap is called with unaligned size.
- 2109fd09 - Reset RFLAGS.AC in EFAULT handler.
- d254591e - Do not continue stack-tracing userspace addresses.
- 39566a25 - Zero-out all head/tail bytes for write-only calls.
- 1384817c - Set RFLAGS.AC in debugger::debugger.
- efd9e787 - WIP: Use strong UserSlice typing.
- 121de1eb - Add UserSlice::{wo,ro,rw}.
- 7181a8fb - Use UserSlice::in_chunks when possible.
- 8a78b8e2 - Revert "Automatically merge adjacent grants."
- 26fd098b - Allow pipe writes of over 512 bytes.
Toggle commit list-
6cbc492c...acefb888 - 2 commits from branch
added 45 commits
-
7dd27dda...846aa32f - 4 commits from branch
redox-os:master
- 846aa32f...5dd1c4b9 - 31 earlier commits
- 8105659d - Do not continue stack-tracing userspace addresses.
- c91ca83d - Zero-out all head/tail bytes for write-only calls.
- 031e4722 - Set RFLAGS.AC in debugger::debugger.
- 266d82c1 - WIP: Use strong UserSlice typing.
- e4a18fc6 - Add UserSlice::{wo,ro,rw}.
- 565a6da4 - Use UserSlice::in_chunks when possible.
- 22de64bc - Revert "Automatically merge adjacent grants."
- 19bbc4ac - Allow pipe writes of over 512 bytes.
- 031d2a47 - Make debug path short-circuit.
- 6b3e88c9 - Split UserSlice::in_chunks to in_{exact,variable}_chunks.
Toggle commit list-
7dd27dda...846aa32f - 4 commits from branch
mentioned in commit 6fca481a
mentioned in merge request !207 (closed)