Closed Bug 1744362 Opened 3 years ago Closed 2 years ago

Introduce a button to temporarily block an injected module in about:third-party

Categories

(Firefox :: Launcher Process, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
relnote-firefox --- 110+
firefox110 --- fixed

People

(Reporter: toshi, Assigned: gstoll)

References

(Depends on 2 open bugs)

Details

Attachments

(15 files, 9 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
383.96 KB, image/png
Details
626.88 KB, image/png
Details
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The current about:third-party page displays read-only contents only. Our next step is to introduce a button on the page so that users can block unwanted modules on their own.

Sorry, there was a problem with the detection of inactive users. I'm reverting the change.

Assignee: nobody → tokikuc
Attached file WIP: Bug 1744362 - Part 2: Minor fixes (obsolete) —
  • AddString should check .Length instead of .MaximumLength
  • SharedSection::Init does not have to take PEHeaders
  • Improve the boundary check in SharedSection::AddDependentModule
  • Use MOZ_LITERAL_UNICODE_STRING in Kernel32ExportsSolver::ResolveInternal
  • Use SharedSection::ConvertToReadOnly in TestCrossProcessWin
  • Use SharedSection::Reset to close the handle in TestCrossProcessWin
  • Typo: s/AddDepenentModule/AddDependentModule/
  • TestCrossProcessWin should compare leaf names

Depends on D159202

Depends on D159203

Depends on D159206

I've posted Toshi's patch set for this work from try revision 570165fbc6ef so we're less likely to lose the patches. These were from March, 2022.

Assignee: tokikuc → nobody
Assignee: nobody → gstoll
Status: NEW → ASSIGNED
  • AddString should check .Length instead of .MaximumLength
  • SharedSection::Init does not have to take PEHeaders
  • Improve the boundary check in SharedSection::AddDependentModule
  • Use MOZ_LITERAL_UNICODE_STRING in Kernel32ExportsSolver::ResolveInternal
  • Use SharedSection::ConvertToReadOnly in TestCrossProcessWin
  • Use SharedSection::Reset to close the handle in TestCrossProcessWin
  • Typo: s/AddDepenentModule/AddDependentModule/
  • TestCrossProcessWin should compare leaf names

Depends on D164483

Depends on D164484

This pulls in the existing wiki page about the blocklist from https://wiki.mozilla.org/Blocklisting/DLL and adds some technical details and information about the new dynamic blocklist.

Depends on D164491

about:third-party with new "block" buttons, but nothing blocked

about:third-party after choosing to block TortoiseOverlays.dll

Two of the three DLLs that Avast injects into Firefox were not properly being blocked when on the dynamic blocklist because they were being loaded before kernel32.dll, and SharedSection::Layout::Resolve() would fail. For the dynamic blocklist part of things we don't actually need the kernel32 exports, so this change moves them to the end of Resolve() and adds an intermediate state where the dynamic blocklist entries have been loaded but not the kernel32 exports. Now all three DLLs can be blocked correctly when on the dynamic blocklist.

Depends on D164492

Pushed by gstoll@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1dd7e7c111da Part 1: Extract macro definitions from WindowsDllBlocklistCommon.h r=handyman https://hg.mozilla.org/integration/autoland/rev/704a4150d210 Part 2: Minor fixes r=handyman https://hg.mozilla.org/integration/autoland/rev/438f74bb5b7c Part 3: Hide SharedSection::Layout r=handyman https://hg.mozilla.org/integration/autoland/rev/c88902b60d1f Part 4: Move mState from Kernel32ExportsSolver to Layout r=handyman https://hg.mozilla.org/integration/autoland/rev/80b67f7ea109 Part 5: Access the shared section through DllServices r=handyman https://hg.mozilla.org/integration/autoland/rev/acfdb2bcaa9f Part 6: use dynamic blocklist file to block third-party DLLs r=handyman https://hg.mozilla.org/integration/autoland/rev/848632184f56 Part 7: support code for about:third-party r=handyman https://hg.mozilla.org/integration/autoland/rev/8b50446f91e5 Part 8: allow blocking of third-party DLLs on about:third-party r=Gijs,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/8c87571dbb3e Part 9: update Enterprise policies schema r=mkaply,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/cf1db931c466 Part 10: update documentation r=handyman https://hg.mozilla.org/integration/autoland/rev/4b2e3689cea0 Part 11: make dynamic blocklist work on DLLs that load before kernel32 r=handyman
Regressions: 1807663

Backed out for causing multiple failures and build bustages.

Flags: needinfo?(gstoll)
Attachment #9307888 - Attachment description: Bug 1744362 - Part 8: allow blocking of third-party DLLs on about:third-party r=gijs → Bug 1744362 - Part 8: allow blocking of third-party DLLs on about:third-party r=Gijs,fluent-reviewers,flod
Attachment #9307889 - Attachment description: Bug 1744362 - Part 9: update Enterprise policies schema r=mkaply → Bug 1744362 - Part 9: update Enterprise policies schema r=mkaply,fluent-reviewers,flod
  • In sandboxBroker.cpp Be more careful about checking whether GetDependentModules() is returning an empty span to avoid ASAN problems
  • In TestCrossProcessWin.cpp, make UniquePtr live as long as the Span that wraps it
  • In LauncherRegistryInfo, mingw doesn't allow using constexpr with expressions containing '|', so just make flags const instead.

Depends on D164738

Pushed by gstoll@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ab1292118c00 Part 1: Extract macro definitions from WindowsDllBlocklistCommon.h r=handyman https://hg.mozilla.org/integration/autoland/rev/0a3ce8ea039e Part 2: Minor fixes r=handyman https://hg.mozilla.org/integration/autoland/rev/d1f4b99f352b Part 3: Hide SharedSection::Layout r=handyman https://hg.mozilla.org/integration/autoland/rev/2911fe484cc3 Part 4: Move mState from Kernel32ExportsSolver to Layout r=handyman https://hg.mozilla.org/integration/autoland/rev/401ebbc0159d Part 5: Access the shared section through DllServices r=handyman https://hg.mozilla.org/integration/autoland/rev/a2d8f526e0ff Part 6: use dynamic blocklist file to block third-party DLLs r=handyman https://hg.mozilla.org/integration/autoland/rev/315c57948afa Part 7: support code for about:third-party r=handyman https://hg.mozilla.org/integration/autoland/rev/da9133df4cd4 Part 8: allow blocking of third-party DLLs on about:third-party r=Gijs,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/39ff51df4a45 Part 9: update Enterprise policies schema r=mkaply,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/34f51e6aee96 Part 10: update documentation r=handyman https://hg.mozilla.org/integration/autoland/rev/0df403e8f6ba Part 11: make dynamic blocklist work on DLLs that load before kernel32 r=handyman https://hg.mozilla.org/integration/autoland/rev/3f63f21115e2 Part 12: fix build and some tests r=handyman

landed changes that should fix these

Flags: needinfo?(gstoll)

The comment mostly explains it. I don't understand why this only happens on PGO builds, but it's 100% reproducible on try builds and the fix seems reasonable enough.

Depends on D165561

Pushed by gstoll@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5105bbfbd67d Part 1: Extract macro definitions from WindowsDllBlocklistCommon.h r=handyman https://hg.mozilla.org/integration/autoland/rev/3ea314484db7 Part 2: Minor fixes r=handyman https://hg.mozilla.org/integration/autoland/rev/f0e4294e5bc2 Part 3: Hide SharedSection::Layout r=handyman https://hg.mozilla.org/integration/autoland/rev/7616ecd9e3f6 Part 4: Move mState from Kernel32ExportsSolver to Layout r=handyman https://hg.mozilla.org/integration/autoland/rev/1685365fd68d Part 5: Access the shared section through DllServices r=handyman https://hg.mozilla.org/integration/autoland/rev/f2d8658ce1b1 Part 6: use dynamic blocklist file to block third-party DLLs r=handyman https://hg.mozilla.org/integration/autoland/rev/9a2bcd63febe Part 7: support code for about:third-party r=handyman https://hg.mozilla.org/integration/autoland/rev/59635f1ed0bd Part 8: allow blocking of third-party DLLs on about:third-party r=Gijs,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/bf477ea61809 Part 9: update Enterprise policies schema r=mkaply,fluent-reviewers,flod https://hg.mozilla.org/integration/autoland/rev/5bc146059945 Part 10: update documentation r=handyman https://hg.mozilla.org/integration/autoland/rev/17351698e3e7 Part 11: make dynamic blocklist work on DLLs that load before kernel32 r=handyman https://hg.mozilla.org/integration/autoland/rev/0524114dbd0e Part 12: fix build and some tests r=handyman https://hg.mozilla.org/integration/autoland/rev/c3b81880d219 Part 13: special-case loading kernel32.dll to avoid crashes r=handyman

landed changes (again :-) ) that should fix these

Flags: needinfo?(gstoll)
Regressions: 1808126
Depends on: 1808328
Regressions: 1808379
Depends on: 1808727
Depends on: 1808735
Depends on: 1808904
Depends on: 1809158

Greg, is that something that needs a mention in our release notes for 110? Thanks

Flags: needinfo?(gstoll)

I think it would be nice to mention in the release notes - :haik, do you agree?

Flags: needinfo?(gstoll) → needinfo?(haftandilian)

(In reply to Greg Stoll from comment #38)

I think it would be nice to mention in the release notes - :haik, do you agree?

Yep, definitely.

Flags: needinfo?(haftandilian)
Depends on: 1809513

Release Note Request (optional, but appreciated)
[Why is this notable]: Allows users to block third-party modules that inject themselves into the Firefox process.
[Affects Firefox for Android]: No
[Suggested wording]: On Windows, third-party modules can now be blocked from injecting themselves into Firefox, which can be helpful if they are causing crashes or other undesirable behavior. See this page for more information. (with link to the SUMO page below)
[Links (documentation, blog post, etc)]: https://support.mozilla.org/en-US/kb/identify-problems-third-party-modules-firefox-windows (this page has not been updated yet)

relnote-firefox: --- → ?
See Also: → 1805677

Note added to our nightly and beta 110 release notes (without the link until the content is updated).

Depends on: 1811271
Depends on: 1811272
Depends on: 1813495

Added to final 110 notes.

Attachment #9298268 - Attachment is obsolete: true
Attachment #9298269 - Attachment is obsolete: true
Attachment #9298270 - Attachment is obsolete: true
Attachment #9298276 - Attachment is obsolete: true
Attachment #9298271 - Attachment is obsolete: true
Attachment #9298275 - Attachment is obsolete: true
Attachment #9298274 - Attachment is obsolete: true
Attachment #9298273 - Attachment is obsolete: true
Attachment #9298272 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: