Linux sandbox debugging

47 views
Skip to first unread message

Sunny Sachanandani

unread,
Nov 17, 2015, 5:14:21 PM11/17/15
to securi...@chromium.org, Antoine Labour
Hi security-dev,

We've been seeing a couple of bugs about high cpu usage in the GPU process that involve the GL driver making a syscall that's blocked by the sandbox. We've tried using strace and other tools but it's not clear what the failure is. I understand that seccomp allows some sort of debugging by sending a SIGSYS when a syscall is blocked. It looks like Mozilla uses this for error reporting. Is there something similar in Chrome? Getting a stack trace for each failed syscall would be awesome.

Thanks!
Sunny

Julien Tinnes

unread,
Nov 17, 2015, 5:27:22 PM11/17/15
to Sunny Sachanandani, security-dev, Antoine Labour, ric...@chromium.org, Matthew Dempsky, ker...@chromium.org
Hi Sunny,

Yes, we have a similar mechanism in Chromium and many system calls trigger a "crash" by design because we don't expect them to ever be used.

If you're not seeing a crash, then the syscall is "gracefully denied", meaning we almost certainly return EPERM or ENOENT. The problem is that userland is sadly failing silently without reporting any error where it should.

There is a mechanism in the sandbox that would allow the sandbox to hook every system calls and still make a decision (in userland) on which one to let through or to deny. See UnsafeTrap here: https://src.chromium.org/chrome/trunk/src/sandbox/linux/seccomp-bpf/sandbox_bpf.h

Unfortunately, we've never finished plugging this in a user-friendly way (https://crbug.com/389383) and it would require some manual work to use.

A potentially quicker alternative could be for you to try and bisect allowing some system call ranges in the GPU policy (bpf_gpu_policy_linux.cc) and see if you can figure out which one you need to allow.

Julien

Ricky Zhou

unread,
Nov 18, 2015, 6:19:18 PM11/18/15
to Julien Tinnes, Sunny Sachanandani, security-dev, Antoine Labour, Matthew Dempsky, ker...@chromium.org
Hey, just checking back - did you manage to figure out the offending
syscall here? Happy to come by and take a look if you'd like some more
eyes on it.

Thanks,
Ricky
Reply all
Reply to author
Forward
0 new messages