Closed Bug 1680166 Opened 5 years ago Closed 5 years ago

Sandbox crashes when building with rustc >= 1.48

Categories

(Core :: Security: Process Sandboxing, task)

task

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox-esr78 --- fixed
firefox85 --- fixed

People

(Reporter: emilio, Assigned: emilio)

Details

Attachments

(1 file)

Visiting pages that require opening files from rust like https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme crashes if you have a local build with rust >= 1.48

Patch incoming.

It's a common way to check the existence of the system call. Since we
handle them, let's return -EFAULT as if it was supported.

This is needed for the sandbox not to constantly crash due to this statx
call in rustc:

https://github.com/rust-lang/rust/blob/09c9c9f7da72b774cc445c0f56fc0b9792a49647/library/std/src/sys/unix/fs.rs#L119-L123

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/60066199c32b Return EFAULT when given a null path to stat* calls in the sandbox filter. r=gcp
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/autoland/rev/d69e924f3538 GCC is smarter than clang, so ignore the warning properly.

Incidentally, that type of nullptr trick is also used by the sandbox to detect seccomp-bpf support / features.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

Can we please get this uplifted into Firefox ESR 78? We are hitting this in Gentoo Linux with latest >=rust-1.50.

Comment on attachment 9190710 [details]
Bug 1680166 - Return EFAULT when given a null path to stat* calls in the sandbox filter. r=jld,gcp

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Linux sandbox fix for newer compilers. See comment 6.
  • User impact if declined: none
  • Fix Landed on Version: 85
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Relatively straight-forward sandbox fix+test.
  • String or UUID changes made by this patch: none
Attachment #9190710 - Flags: approval-mozilla-esr78?

Comment on attachment 9190710 [details]
Bug 1680166 - Return EFAULT when given a null path to stat* calls in the sandbox filter. r=jld,gcp

Approved for 78.11esr.

Attachment #9190710 - Flags: approval-mozilla-esr78? → approval-mozilla-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: