Skip to content

Instantly share code, notes, and snippets.

@imlk0
Last active April 25, 2024 13:37
Show Gist options
  • Save imlk0/7f0acf0239f9b1388be55f5cd0bb2b43 to your computer and use it in GitHub Desktop.
Save imlk0/7f0acf0239f9b1388be55f5cd0bb2b43 to your computer and use it in GitHub Desktop.

GSoC 2021 Work Product Submission

Describe my work briefly

proot-rs is an unprivileged chroot, written in Rust. The current implementation of proot-rs is not yet ready to be used.

What I need to to is finish the first release ready version, more specifically, including implementing path translation, implementing loading ELF files and script files, and adding multi-tracee support.

What is done

  • Fix the incorrect return value of system call.
  • Fix the incorrect handling of trailing slash in paths during path translation.
  • Fix the problem of incorrect handling of shebang.
  • Fix the existing unit test function test_in_subprocess() so that it can report failed tests correctly.
  • Add support for path translation.
  • Add support for multi-tracee.
  • Add support for cross-compiling, including compiling to Android platform.
  • Add unit test helper function test_with_proot() to enable testing proot-rs event loops in unit tests.
  • Add integration tests.
  • Port loader.c to Rust
  • Refactor errors.rs.
  • Refactor executable loading process to support iterative loading.
  • Add GitHub workflow scripts to automate testing and building release files.

Todo

  • Unable to run in Termux application. #62
  • In some cases, failed to cross-compile proot-rs using docker-compose. #56
  • Some system calls like unshare(CLONE_FS) may break emulation of tracee's cwd field. #42
  • getdents64() may cause information about the overwritten path to be returned incorrectly. #43
  • Document some differences between the proot and proot-rs. #29 #30

Others

Useful links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment