Closed Bug 1775445 Opened 4 years ago Closed 3 years ago

many violations continuously reported: Sandbox: seccomp sandbox violation: syscall 23 (select)

Categories

(Core :: Security: Process Sandboxing, defect, P3)

Firefox 101
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ben, Unassigned)

Details

Steps to reproduce:

Run firefox.

Actual results:

The line "Sandbox: seccomp sandbox violation: pid 251145, tid 251152, syscall 23, args 15 140440833636064 140440833636192 140440833636320 0 0." is printed many times a second for the entire duration that firefox is running.

Syscall 23 is select, which would explain why it's being violated so often. But I don't notice any problems using firefox itself, only this message being printed.

Expected results:

No sandbox violation occurs.

The Bugbug bot thinks this bug should belong to the 'Core::Security: Process Sandboxing' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Security: Process Sandboxing
Product: Firefox → Core

More information:

Exact log

Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=11.2944) [GFX1-]: glxtest: libpci missing
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
JavaScript error: resource:///modules/BrowserGlue.jsm, line 2012: TypeError: addon is null
Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
Sandbox: seccomp sandbox violation: pid 260512, tid 260523, syscall 23, args 15 140377755555552 140377755555680 140377755555808 140377755555488 0.
Sandbox: seccomp sandbox violation: pid 260512, tid 260523, syscall 23, args 15 140377755555552 140377755555680 140377755555808 140377755555488 0.
Sandbox: seccomp sandbox violation: pid 260512, tid 260523, syscall 23, args 15 140377755555552 140377755555680 140377755555808 0 0.
Sandbox: seccomp sandbox violation: pid 260512, tid 260523, syscall 23, args 15 140377755555552 140377755555680 140377755555808 0 0.
Sandbox: seccomp sandbox violation: pid 260512, tid 260523, syscall 23, args 15 140377755555552 140377755555680 140377755555808 0 0.
# same line repeated...

Build tools

Compiler Version Compiler flags
/usr/lib/ccache/bin/cc -std=gnu99 11.2.0 -O2 -pipe -march=native -fPIC -ffunction-sections -fdata-sections -fno-math-errno -pthread -pipe
/usr/lib/ccache/bin/c++ 11.2.0 -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -O2 -pipe -march=native -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -O2 -pipe -march=native -w -fomit-frame-pointer -funwind-tables
/usr/bin/rustc 1.59.0 --remap-path-prefix=/tmp/12345/build/firefox=. --remap-path-prefix=/tmp/12345/build/firefox=. -Cdebuginfo=0

Configure options

--enable-application=browser MOZBUILD_STATE_PATH=/tmp/12345/build/firefox/state --disable-tests '--enable-optimize=-O2 -pipe -march=native -w' CC=cc CXX=c++ --enable-linker=bfd MOZ_DEBUG_FLAGS=-g0 --disable-debug-symbols AR=ar NM=nm --disable-jemalloc --enable-audio-backends=alsa 'RUSTFLAGS=--remap-path-prefix=/tmp/12345/build/firefox=. --remap-path-prefix=/tmp/12345/build/firefox=. -Cdebuginfo=0' --with-system-ffi --enable-rust-simd --disable-eme --disable-elf-hack --disable-accessibility --with-system-libvpx --with-system-jpeg --with-system-png --without-wasm-sandboxed-libraries --disable-updater --disable-crashreporter --disable-dbus --disable-necko-wifi --disable-parental-controls --disable-system-extension-dirs --with-system-pixman --enable-strip --with-system-zlib --enable-official-branding --libdir=/usr/lib --prefix=/usr

Can you get a stack trace from where that happens? Normally I'd suggest reproducing this with MOZ_SANDBOX_CRASH_ON_ERROR=1 set in the environment and commenting with the crash report link from about:crashes, but from comment #2 this looks like a local build without crash reporting. In that case, maybe rebuilding with debug info, attaching gdb, and setting a breakpoint on the log message would work. Alternately, running with MOZ_SANDBOX_CRASH_ON_ERROR=1 should print a stack trace (because the crash reporter is disabled), but that may not have symbol names.

In theory nothing in our code should be using select, at least on Linux (and and we try not to, given that using it correctly when fds can be larger than FD_SETSIZE is nontrivial). But we've had problems in the past with injected libraries from /etc/ld.so.preload, or there might be something going on in some system library.

Flags: needinfo?(ben)
Severity: -- → S3
Priority: -- → P3

Thanks for your reply. Sorry - I'm having trouble getting gdb to break on the log message. What I've tried is:

  • Build with debug symbols.
  • gdb firefox
  • l SigSysHandler
  • b 145
  • run

But the violation warning message still prints without triggering the breakpoint, presumably because gdb isn't following the child printing the message. So I tried setting set follow-fork-mode child and also set detach-on-fork off, but this just caused it to hang. Forgive my incompetence!

In fact trying this again I can't get it to find the security/sandbox/linux/Sandbox.cpp file:

(gdb) b security/sandbox/linux/Sandbox.cpp
Function "security/sandbox/linux/Sandbox.cpp" not defined.
(gdb) l SigSysHandler
Function SigSysHandler not defined.

Running with MOZ_SANDBOX_CRASH_ON_ERROR=1 gives this:

~ $ MOZ_SANDBOX_CRASH_ON_ERROR=1 firefox
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.417424) [GFX1-]: glxtest: libpci missing
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
Sandbox: seccomp sandbox violation: pid 18483, tid 18490, syscall 23, args 15 140388663392096 140388663391968 140388663391840 140388663391760 0.  Killing process.
Sandbox: crash reporter is disabled (or failed); trying stack trace:
JavaScript error: moz-extension://30d28fc9-1b12-4802-8448-a56880ed5eca/extension-utils.js, line 51: Error: Attempt to postMessage on disconnected port
Sandbox: frame #01: __setjmp[/lib/ld-musl-x86_64.so.1 +0x78588]
Sandbox: end of stack.

The reason the crash reporter is disabled is because it doesn't currently work on musl.

A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Closing the bug as incomplete.

For more information, please visit BugBot documentation.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(ben)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.