Closed Bug 1583368 Opened 5 years ago Closed 5 years ago

Ensure we don't use sccache on dependencies of shippable builds

Categories

(Firefox Build System :: Task Configuration, task)

task
Not set
normal

Tracking

(firefox-esr60 wontfix, firefox-esr6870+ fixed, firefox69+ fixed, firefox70+ fixed, firefox71+ fixed)

RESOLVED FIXED
mozilla71
Tracking Status
firefox-esr60 --- wontfix
firefox-esr68 70+ fixed
firefox69 + fixed
firefox70 + fixed
firefox71 + fixed

People

(Reporter: rstewart, Assigned: rstewart)

References

Details

(Keywords: sec-other, Whiteboard: [adv-esr68.2-])

Attachments

(1 file, 1 obsolete file)

No description provided.

This should be as simple as adding the win64-sccache toolchain to the win32-shippable and win64-shippable builds in taskcluster/ci/instrumented-build/kind.yml, and verifying that we get sccache hits on try. For reference, taskcluster/ci/build/windows.yml has sccache enabled for most Windows builds.

I do not think we can have sccache enabled for builds used in the release process (which instrumented builds are). sccache uses S3 (or gcs) to store artifacts, and we don't have any way to verify that those artifacts aren't modified between creation and use (or to verify that they were ever created by a trusted build).

Morphing bug based on comment 4. Tom also pointed me at https://searchfox.org/mozilla-central/rev/45f30e1d19bde27bf07e47a0a5dd0962dd27ba18/taskcluster/taskgraph/util/verify.py#235-240 which should be adjusted to catch things like this.

Group: firefox-core-security
Summary: Add sccache to Windows instrumented builds → Ensure we don't use sccache on dependencies of shippable builds
Attachment #9094762 - Attachment description: Fix Bug 1583368. Add the win64-sccache to win32-shippable and win64-shippable builds. → Fix Bug 1583368. Don't use sccache on dependencies of shippable builds
Attachment #9094995 - Attachment is obsolete: true

:hwine, can you provide some guidance on how to proceed here and land this? Presumably we'd also want to uplift to beta & release.

Flags: needinfo?(hwine)

:catlee, can you comment on how this might impact the overall TC load? We'd be turning off sccache on the Linux & Android instrumented ("instr") builds. Historically, we didn't have sccache on the nightly PGO builds, but I think we did for the non-nightly PGO builds. Now, shippable builds and any non-shippable PGO builds use the profile data derived from the same instrumented builds, so they need to not use sccache.

Flags: needinfo?(catlee)

(In reply to Michael Shal [:mshal] from comment #8)

:hwine, can you provide some guidance on how to proceed here and land this? Presumably we'd also want to uplift to beta & release.

I think the following 2 steps should be sufficient to land:

  • check with RelEng on any potential load/performance issues and any uplift criteria they have (comment 9 addresses this)
  • get a code review from RelEng and/or Taskcluster that the patch addresses all the cases we're concerned about.
Flags: needinfo?(hwine)
Keywords: sec-other

I suspect this will result in a marginal but acceptable increase in load. We could mitigate that by only disabling sccache on repositories we ship from. i.e. could we leave sccache enabled for shippable builds on try and autoland?

Flags: needinfo?(catlee)

Note that this is not a regression from 1-tier PGO, since we weren't running sccache with shippable builds then.

Group: firefox-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71

I want to ask why? What's the risk of the instrumented builds having their build cache tempered with? The only one I can think of is getting suboptimal optimizations as a result.

Comment on attachment 9094762 [details]
Fix Bug 1583368. Don't use sccache on dependencies of shippable builds

Beta/Release Uplift Approval Request

  • User impact if declined: No impact to end users.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This change just disables sccache on instrumented builds. The builds work fine without sccache, they just take longer to complete.
  • String changes made/needed:

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration:
  • User impact if declined: No impact to end users.
  • Fix Landed on Version:
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky):
  • String or UUID changes made by this patch:
Attachment #9094762 - Flags: approval-mozilla-release?
Attachment #9094762 - Flags: approval-mozilla-esr68?
Attachment #9094762 - Flags: approval-mozilla-beta?

(In reply to Mike Hommey [:glandium] from comment #14)

I want to ask why? What's the risk of the instrumented builds having their build cache tempered with? The only one I can think of is getting suboptimal optimizations as a result.

As I understand it, the risk is that a specific object file could be crafted and injected into the cache, such that when the instrumented Firefox binary runs, it generates malformed profile data that triggers an exploit in clang to cause the final profile-use build to contain arbitrary code. Without such an exploit in clang, the risk then just becomes suboptimal optimizations.

Comment on attachment 9094762 [details]
Fix Bug 1583368. Don't use sccache on dependencies of shippable builds

Doesn't affect the builds we ship in the end, just mitigates a possible opportunity for bad actors to compromise them via sccache. Approved for all the things.

Attachment #9094762 - Flags: approval-mozilla-release?
Attachment #9094762 - Flags: approval-mozilla-release+
Attachment #9094762 - Flags: approval-mozilla-esr68?
Attachment #9094762 - Flags: approval-mozilla-esr68+
Attachment #9094762 - Flags: approval-mozilla-beta?
Attachment #9094762 - Flags: approval-mozilla-beta+
Regressions: 1585558
Whiteboard: [adv-esr68.2-]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: