Commit 481376c0 authored by Paul Adenot's avatar Paul Adenot
Browse files

Bug 1686681 - Handle ioctl(TCGETS, ...) by saying this is not a TTY. r=jld

When doing (e.g.) `MOZ_LOG=PlatformDecoderModule:4`, ffmpeg ends up doing
`ioctl(TCGETS, ...)` via `tcgetattr`, and this crashes the RDD. We don't care
much about the result, so let's just say `ENOTTY`.

Differential Revision: https://phabricator.services.mozilla.com/D113162
parent 732bfd4d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1707,7 +1707,13 @@ class RDDSandboxPolicy final : public SandboxPolicyCommon {
    switch (sysno) {
      case __NR_getrusage:
        return Allow();

      case __NR_ioctl: {
        Arg<unsigned long> request(1);
        // ffmpeg, and anything else that calls isatty(), will be told
        // that nothing is a typewriter:
        return If(request == TCGETS, Error(ENOTTY))
            .Else(InvalidSyscall());
       }
      // Pass through the common policy.
      default:
        return SandboxPolicyCommon::EvaluateSyscall(sysno);