1. 17 Jan, 2021 2 commits
  2. 03 Jan, 2021 20 commits
  3. 18 Dec, 2020 4 commits
  4. 15 Dec, 2020 1 commit
  5. 14 Dec, 2020 7 commits
  6. 13 Dec, 2020 6 commits
    • Max Rees's avatar
      Move all handler files into handlers/ · e4a49e83
      Max Rees authored
      e4a49e83
    • Max Rees's avatar
      Centralize syscall table into one location · fb5cc2ce
      Max Rees authored
      fb5cc2ce
    • Max Rees's avatar
      Overhaul the main program to prevent deadlocking · e152ac41
      Max Rees authored
      The previous naive approach relied on setting up and loading the seccomp
      filter in the first process, then immediately executing the desired
      process. This had the unfortunate effect of causing deadlocks in the
      parent when part of its syscall emulation involved a syscall that was
      also part of the child's seccomp filter (after all, the filter was also
      active in the parent).
      
      Now we have a multi-stage approach:
      
      * The first process (stage 1) sets up a socketpair and produces a child
      * The child (stage 2) sets up the filter and sends the notification FD
        and PID of the end-user's process back to the stage 1 process, then
        exits.
      * Stage 2 is now over. Stage 1 can receive all seccomp notifications
        from the third process and its descendants without deadlocking if it
        itself calls those same syscalls.
      
      Part of the magic is taking advantage of SCM_RIGHTS to pass the
      notification FD around as well as PR_SET_CHILD_SUBREAPER to make sure
      none of the descendants escape. The latter will also be useful in the
      future when it is necessary to track the uid, euid, et al of the
      children.
      e152ac41
    • Max Rees's avatar
      Rename file_get to file_upsert_path and split out file_get from it · 9a537063
      Max Rees authored
      file_upsert_path is useful if you need to add a new file override entry
      or update the existing one. In other cases we need to just check if
      there is already an entry (e.g. during stat(2) calls), which you can now
      use file_get for.
      9a537063
    • Max Rees's avatar
      Split out two subroutines from pull_pathname · 6ec3f50e
      Max Rees authored
      Now we can also write back to the tracee using tx_data(push=1). In the
      future if we need to rewrite only a pathname in a syscall we could also
      mutate pull_pathname into tx_pathname(push=).
      
      Use check_pathname to ensure PATH_MAX paths from tx_data() don't
      overflow. pull_pathname automatically calls this for you.
      6ec3f50e
    • Max Rees's avatar
      Finish function visibility fixups · b0733d66
      Max Rees authored
      handle_chown_inner may be used at a later point by other syscalls so we
      will leave it with extern linkage for now
      b0733d66