Closed Bug 1814217 Opened 1 year ago Closed 1 year ago

Crash releasing RefPtr<mozilla::net::HttpTransactionShell> in [@ mozilla::net::nsHttpChannel::~nsHttpChannel ]

Categories

(Core :: Networking, defect, P2)

67 Branch
defect

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox-esr102 112+ fixed
firefox111 --- wontfix
firefox112 + fixed
firefox113 + fixed

People

(Reporter: jesup, Assigned: valentin)

References

(Regression)

Details

(4 keywords, Whiteboard: [necko-triaged][necko-priority-queue][post-critsmash-triage][adv-main112+r][adv-esr102.10+r])

Crash Data

Attachments

(1 file)

Crash releasing RefPtr<mozilla::net::HttpTransactionShell>, https://crash-stats.mozilla.org/report/index/b6d53475-f344-4f03-ba2a-9b2790230130

e5e5 address, not sure how that apparently got into the RefPtr or if the memory for the member got mass-overwritten.

+++ This bug was initially created as a clone of Bug #1544127 +++

Priority: -- → P2
Whiteboard: [necko-triaged][necko-priority-review]
Severity: -- → S3

The severity field for this bug is set to S3. However, the bug is flagged with the sec-high keyword.
:jesup, could you consider increasing the severity of this security bug?

For more information, please visit auto_nag documentation.

Flags: needinfo?(rjesup)
Severity: S3 → S2
Flags: needinfo?(rjesup)
Whiteboard: [necko-triaged][necko-priority-review] → [necko-triaged][necko-priority-review][necko-next]
Whiteboard: [necko-triaged][necko-priority-review][necko-next] → [necko-triaged][necko-priority-queue]

I'll take a look into the crash dumps for some clue about what's wrong.

Assignee: nobody → valentin.gosu

I was looking at this bug for a while.
One thing I noticed is that mEarlyHintObserver and mChannelClassifier are not thread safe. However, these should be released before the ~nsHttpChannel destuctor - when the call to ReleaseListeners happens from OnStopRequest.

There are a few of the crashes that point to freed memory.
https://crash-stats.mozilla.org/report/index/e633a6a0-1e67-4da7-ada4-031840230208
https://crash-stats.mozilla.org/report/index/2fde231f-ebc7-4d9c-abc8-cfd690230221
https://crash-stats.mozilla.org/report/index/b6d53475-f344-4f03-ba2a-9b2790230130
Some of the Android ones report Available Page File: 0

So far this seems to be similar to bug 1544127.

Keywords: regression

The patch also adds a diagnostic assert that the objects have actually been released in nsHttpChannel::ReleaseListeners

Comment on attachment 9321370 [details]
Bug 1814217 - Dispatch release of main thread objects in ~nsHttpChannel r=#necko

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: This is more of a speculative patch. We now dispatch the release of non-threadsafe objects to the main thread instead.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Unknown
  • Which older supported branches are affected by this flaw?: all
  • If not all supported branches, which bug introduced the flaw?: None
  • Do you have backports for the affected branches?: Yes
  • If not, how different, hard to create, and risky will they be?: Applies cleanly to ESR 102.
  • How likely is this patch to cause regressions; how much testing does it need?: Not likely to cause regressions - with the exception of early beta and nightly where we intentionally diagnostic assert to be able to detect such cases and fix the root cause.
  • Is Android affected?: Yes
Attachment #9321370 - Flags: sec-approval?

Comment on attachment 9321370 [details]
Bug 1814217 - Dispatch release of main thread objects in ~nsHttpChannel r=#necko

Approved to land and uplift if desired.

Attachment #9321370 - Flags: sec-approval? → sec-approval+
Group: network-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch

The patch landed in nightly and beta is affected.
:valentin, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox112 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(valentin.gosu)

Comment on attachment 9321370 [details]
Bug 1814217 - Dispatch release of main thread objects in ~nsHttpChannel r=#necko

Beta/Release Uplift Approval Request

  • User impact if declined: Possible UAF
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • 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): Doesn't cause a behaviour change - just dispatches release of main thread objects if nsHttpChannel is released off-main-thread.
  • String changes made/needed:
  • Is Android affected?: Unknown
Attachment #9321370 - Flags: approval-mozilla-release? → approval-mozilla-beta?
Attachment #9321370 - Flags: approval-mozilla-esr102?

Comment on attachment 9321370 [details]
Bug 1814217 - Dispatch release of main thread objects in ~nsHttpChannel r=#necko

Approved for 112.0b3

Attachment #9321370 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9321370 [details]
Bug 1814217 - Dispatch release of main thread objects in ~nsHttpChannel r=#necko

Approved for 102.10esr

Attachment #9321370 - Flags: approval-mozilla-esr102? → approval-mozilla-esr102+
Flags: qe-verify-
Whiteboard: [necko-triaged][necko-priority-queue] → [necko-triaged][necko-priority-queue][post-critsmash-triage]
Whiteboard: [necko-triaged][necko-priority-queue][post-critsmash-triage] → [necko-triaged][necko-priority-queue][post-critsmash-triage][adv-main112+r]
Whiteboard: [necko-triaged][necko-priority-queue][post-critsmash-triage][adv-main112+r] → [necko-triaged][necko-priority-queue][post-critsmash-triage][adv-main112+r][adv-esr102.10+r]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: