Closed Bug 1885218 Opened 8 months ago Closed 8 months ago

Add more logging for fatal errors in sandboxed process launch on Linux

Categories

(Core :: Security: Process Sandboxing, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: jld, Assigned: jld)

References

Details

Attachments

(1 file)

Inspired by bug 1884347, and its possible duplicate in bug 1884593: there are places in the sandbox's process launching where we can MOZ_CRASH at a point where we know the crash reporter doesn't work. Because MOZ_CRASH doesn't log anything to stderr on release builds, this results in difficult-to-interpret bug reports. However, we already have the SANDBOX_LOG macros for doing logging to stderr in a way that's safe here (i.e., async signal safe), and that's already done in some places in SandboxLaunch.cpp. So, I thought I'd add a few more.

In this code there are conditions where we can't proceed, but simply
MOZ_CRASHing isn't ideal, because the crash reporter doesn't work
here, and on non-debug builds the crash string isn't printed to the
terminal, so we get bug reports where we know that something crashed
somewhere but not much else.

Because we already have the SANDBOX_LOG macros (which are intended to
be async signal safe), this patch uses them to add some more logging.

This patch also makes sure that WriteStringToFile always sets errno to
something when returning failure, because that matters for some of this
new logging.

Assignee: nobody → jld
Status: NEW → ASSIGNED
Severity: -- → S4
Pushed by jedavis@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/073706ebc100 Add more logging for fatal errors during Linux sandbox process launch. r=gcp
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: