Closed Bug 1747439 Opened 2 years ago Closed 2 years ago

Fix a bunch of locking/race issues in cache2

Categories

(Core :: Networking: Cache, defect, P2)

defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox96 --- wontfix
firefox97 + fixed
firefox98 + fixed

People

(Reporter: jesup, Assigned: jesup)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-race, sec-moderate, Whiteboard: [post-critsmash-triage][post-critsmash-triage][adv-main97+r])

Attachments

(1 file)

Clang static thread-safety analysis found a number of issues in netwerk/cache2. See the patch. I moved mPinned to an Atomic to avoid adding a bunch of additional locking (similar to mDoomed). (I'll note that if mDoomed hadn't already been moved to an Atomic in bug 1692299 a few days ago, I would have had fixes for that too - it had flagged that as not locked properly). Also does some minor related cleanup (I think we were locking around mDoomed in at least one place still).

Severity: -- → S3
Priority: -- → P2
Whiteboard: [necko-triaged]
Assignee: nobody → rjesup
Status: NEW → ASSIGNED

Landed: https://hg.mozilla.org/integration/autoland/rev/7c1a1109d729b5c52f547c2836c34a8a358b9464

Backed out for causing build bustages in CacheEntry.cpp:
https://hg.mozilla.org/integration/autoland/rev/baba2bcc677f19df575c4f50c3541661395ce41f

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception&fromchange=adcafb4a8a20400decd88d0b7501d407afa51aa4&tochange=baba2bcc677f19df575c4f50c3541661395ce41f&selectedTaskRun=EtFAzYXdQcGlK8TV-XZShQ.0
Failure log: https://treeherder.mozilla.org/logviewer?job_id=363868651&repo=autoland&lineNumber=21507

/builds/worker/checkouts/gecko/netwerk/cache2/CacheEntry.cpp:1899:20: error: out-of-line definition of 'SizeOfExcludingThis' does not match any declaration in 'mozilla::net::CacheEntry'
/builds/worker/checkouts/gecko/netwerk/cache2/CacheEntry.cpp:1922:20: error: out-of-line definition of 'SizeOfIncludingThis' does not match any declaration in 'mozilla::net::CacheEntry' 
Flags: needinfo?(rjesup)

Aha. There was a mis-merge from hg histedit. Fixed

Flags: needinfo?(rjesup)
See Also: → 1745972
Group: core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

The patch landed in nightly and beta is affected.
:jesup, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(rjesup)

Comment on attachment 9257733 [details]
Bug 1747439: netwerk/cache2 cleanup r=#necko-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined: Possible data races
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • 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): adds/moves a few locks. Locks verified by static analysis, and baked on Nightly for a few weeks with no reported deadlocks
  • String changes made/needed: none
Flags: needinfo?(rjesup)
Attachment #9257733 - Flags: approval-mozilla-beta?

Comment on attachment 9257733 [details]
Bug 1747439: netwerk/cache2 cleanup r=#necko-reviewers

Approved for 97.0b9.

Attachment #9257733 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Whiteboard: [necko-triaged] → [necko-triaged][post-critsmash-triage]
Whiteboard: [necko-triaged][post-critsmash-triage] → [post-critsmash-triage][post-critsmash-triage][adv-main97+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: