Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOZ_CRASH(seccomp+tsync failed, but kernel supports tsync) when recording Firefox #1781

Closed
theres-waldo opened this issue Aug 29, 2016 · 8 comments

Comments

@theres-waldo
Copy link

STR:

  1. Install rr
  2. Run a local build of mozilla-central with |mach run --debugger rr|
  3. Load any webpage

Expected results:
The page loads.

Actual results:
The content process crashes, with the following output:

Sandbox: thread-synchronized seccomp failed: Function not implemented
Hit MOZ_CRASH(seccomp+tsync failed, but kernel supports tsync) at /home/botond/dev/mozilla/central/security/sandbox/linux/Sandbox.cpp:452

Originally filed as https://bugzilla.mozilla.org/show_bug.cgi?id=1298869, where :jld diagnosed it as an rr bug, hence I'm filing it here now.

@rocallahan
Copy link
Collaborator

What kernel version and Gecko changeset are you using?

@theres-waldo
Copy link
Author

Kernel version: 3.16.0-4-amd64
Gecko changeset: https://hg.mozilla.org/mozilla-central/rev/8ef9629d8f90 + unrelated local patches

@jld
Copy link

jld commented Aug 29, 2016

FYI, SECCOMP_FILTER_FLAG_TSYNC first appeared in 3.17 (torvalds/linux@c2e1f2e) but some distributions backported it (e.g., in Ubuntu Trusty it goes back to the tag Ubuntu-3.13.0-40.67). The seccomp syscall is part of the same patch set. This problem seems to need a kernel that doesn't support the seccomp syscall; there are more details on the Bugzilla bug.

@theres-waldo
Copy link
Author

rr with this patch does not build for me:

/home/botond/dev/mozilla/rr/obj/32/seccomp_tsync.c: In function ‘install_filter’:
/home/botond/dev/mozilla/rr/obj/32/seccomp_tsync.c:17:54: error: ‘SECCOMP_FILTER_FLAG_TSYNC’ undeclared (first use in this function)
   ret = syscall(RR_seccomp, SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
                                                      ^
/home/botond/dev/mozilla/rr/obj/32/seccomp_tsync.c:17:54: note: each undeclared identifier is reported only once for each function it appears in
/home/botond/dev/mozilla/rr/rr/src/test/seccomp_tsync.c: In function ‘install_filter’:
/home/botond/dev/mozilla/rr/rr/src/test/seccomp_tsync.c:17:54: error: ‘SECCOMP_FILTER_FLAG_TSYNC’ undeclared (first use in this function)
   ret = syscall(RR_seccomp, SECCOMP_SET_MODE_FILTER, SECCOMP_FILTER_FLAG_TSYNC,
                                                      ^
/home/botond/dev/mozilla/rr/rr/src/test/seccomp_tsync.c:17:54: note: each undeclared identifier is reported only once for each function it appears in

@rocallahan
Copy link
Collaborator

Hopefully fixed by 60aa4ca

@theres-waldo
Copy link
Author

Almost:

/home/botond/dev/mozilla/rr/rr/src/SeccompFilterRewriter.cc: In function ‘void rr::install_patched_seccomp_filter_arch(rr::RecordTask*, std::unordered_map<unsigned int, short unsigned int>&, std::vector<unsigned int>&)’:
/home/botond/dev/mozilla/rr/rr/src/SeccompFilterRewriter.cc:111:29: error: ‘SECCOMP_FILTER_FLAG_TSYNC’ was not declared in this scope
         (t->regs().arg2() & SECCOMP_FILTER_FLAG_TSYNC)) {
                             ^

@rocallahan
Copy link
Collaborator

Argh! Try again.

@theres-waldo
Copy link
Author

Compiles now, and fixes the crash. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants