1. 15 Mar, 2019 1 commit
    • topjohnwu's avatar
      Make sure rootfs file selabels are correct · a1b5185e
      topjohnwu authored
      Android Q init assumes rootfs to always be on EXT4 images, thus
      never runs restorecon on the whole root directory. This is an issue
      because some folders in rootfs were set with special selabels in
      the system partition, but when copying over to initramfs by magiskinit,
      these labels will not be preserved.
      
      So the solution is to relabel the files in rootfs with the original
      context right? Yes, but rootfs does not allow security xattr to be set
      on files before the kernel SELinux initializes with genfs_contexts.
      We have to load our sepolicy to the kernel before we clone the root
      directory from system partition, which we will also restore the selabel
      in the meantime.
      
      Unfortunately this means that for each reboot, the exact same policy
      will be loaded to the kernel twice: once in magiskinit so we can label
      rootfs properly, and once by the original init, which is part of the
      boot procedure. There is no easy way to prevent init from loading
      sepolicy, as init will refuse to continue if policy loading has failed.
      a1b5185e
  2. 14 Mar, 2019 2 commits
  3. 13 Mar, 2019 7 commits
  4. 12 Mar, 2019 6 commits
  5. 11 Mar, 2019 6 commits
  6. 10 Mar, 2019 4 commits
    • topjohnwu's avatar
      Don't care if child threads were unknown · 51110866
      topjohnwu authored
      51110866
    • topjohnwu's avatar
      Use RAII to detach PIDs · 20f20481
      topjohnwu authored
      20f20481
    • topjohnwu's avatar
      Allow zygote to execve · 4581354e
      topjohnwu authored
      Allow zygote to execute other programs (such as dex2oat).
      This fixes the bug that cause ART framework boot images failed to load
      and result to extremely serious performance degradation.
      
      Fix #1195
      4581354e
    • topjohnwu's avatar
      Use large vector<bool> instead of set<pid> · faf4d763
      topjohnwu authored
      vector<bool> uses bitsets, so we actually only use 12k memory to
      store all 3 possible PID info tables. PID checkup will be now become
      O(1) instead of O(logn).
      
      P.S. The reason why we don't use unordered_map is because including it
      will result in significant binary size increase (might be due to the
      complex hash table STL implementation? I really don't know).
      faf4d763
  7. 09 Mar, 2019 7 commits
  8. 08 Mar, 2019 7 commits