You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b028f2d
Browse filesBrowse the repository at this point in the historyBrowse files
Second sweep: every remaining ad-hoc unsafe block in business logic now
delegates to src/sys.rs wrappers or uses plain safe Rust.
- tracee/mem.rs: process_vm_*/PTRACE_PEEK|POKEDATA via sys::; the
errno-carrying word primitives keep C's clear-errno convention.
File is now unsafe-free.
- tracee/reg.rs: byte-offset register access rewritten as slice ops on
sys::as_bytes views of user_regs_struct — no more pointer arithmetic.
- tracee/seccomp.rs: transmute_copy(&statfs64.f_fsid) replaced by an
offset_of!+as_bytes read; getresuid/getresgid/statfs64 via sys::.
- syscall/{enter,exit,socket,seccomp,rlimit,heap}.rs: errno clears,
lstat/stat/readlink/prlimit/prctl calls via sys::; sockaddr_un path
copies use safe zip loops; ioctl/poll wrappers.
- execve/{enter,exit,ldso,shebang,auxv}.rs: pread/open/access/fchmod
via sys::; iterate_program_headers closure no longer smuggles
raw pointers (plain captures suffice); loader File via
sys::file_from_fd.
- path/{mod,canon,binding,glue,f2fs}.rs: lstat/realpath/getcwd/readlink/
mkdir/mknod/fork/waitpid via sys::; fix_symlink_size's misaligned
buf.cast::<stat>() replaced by a typed struct (same latent UB fix as
fake_id0).
- extension/sysvipc/*: helper-process socket glue (pipe/fork/dup2/
exec/listen/accept/read/write) via sys::; SCM_RIGHTS cmsghdr built by
byte layout instead of CMSG_* macros; tmpfile() replaced by an
O_TMPFILE wrapper.
- ptrace/{mod,wait}.rs: ptrace emulation calls via sys::ptrace (which
now takes usize words — no raw-pointer args in a safe fn).
- extension/kompat.rs uname, cli/mod.rs setenv/getpid, main.rs atexit,
lib.rs strerror — all via sys::.
- sys.rs gains: process_vm_read/write/writev_bufs, prlimit64, dup2,
file_from_fd, tmpfile_fd, statfs64, strerror.
Result: `unsafe` outside the kernel boundary dropped from ~276 sites
across 43 files to 12 (sys.rs=100 audited wrappers, elf.rs=8 POD-union
accessors, event.rs=3 signal/uname sites, netlink.rs=1 documented
CStr::from_ptr). Every remaining site carries a SAFETY comment;
unsafe_op_in_unsafe_fn stays denied.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0 commit comments