Commit 6cce8fe2 authored by Matthew Fernandez's avatar Matthew Fernandez
Browse files

fix: allow time() and gettimeofday() in the sandbox when single-threaded

Commits 49885368 and
3ee7d3d3 added time() and gettimeofday() as
permitted syscalls to the Linux seccomp sandbox. This was necessary for
platforms which do not implement these two in vDSO. However, a copy and paste
error resulted in them only being allowed in a multithreaded verifier. This was
not picked up in CI as we only test the Linux sandbox on x86-64 where these two
syscalls *are* implemented in vDSO.

I was only able to debug this indirectly by seeing surprising failures in the
Debian build logs for v2020.02.17-1 on mips64el [0] and mipsel [1]. I had
expected these two platforms to pass as there had been intermediate commits
since v2020.01.27-1 (including the two referenced above) to address all known
failures, but instead we have the following results for basic-sandbox.m:

  +------ debug
  |+----- optimised
  ||+---- multithreaded
  |||+--- XML
  ||||                       mips64el   mipsel   hppa
                             F (fail)      F       F
     X                           F         F       F
    M                        P (pass)      P       P
    MX                       S (skip)      S       S
   O                             F         F       F
   O X                           F         F       F
   OM                            P         P       P
   OMX                           S         S       S
  D                              F         F       F
  D M                            P         P       P
  DO                             F         F       F
  DOM                            P         P       P

Further confusing the situation, the strace-sandbox test passed. Then I noticed
the coincidence of the multithreaded cases passing, looked for `THREADS > 1`
conditions and found the root cause. It was only subsequently that I noticed the
hppa log [2] exhibited the same pattern and the strace-sandbox test failed there
with an attempt to call time(), directly pointing at the cause.

  [0]: https://buildd.debian.org/status/fetch.php?pkg=rumur&arch=mips64el&ver=2020.02.17-1&stamp=1582139136&raw=0
  [1]: https://buildd.debian.org/status/fetch.php?pkg=rumur&arch=mipsel&ver=2020.02.17-1&stamp=1582146235&raw=0
  [2]: https://buildd.debian.org/status/fetch.php?pkg=rumur&arch=hppa&ver=2020.02.17-1&stamp=1582161344&raw=0
parent 47588ec7
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment