Closed Bug 1768907 Opened 9 months ago Closed 4 months ago

nsTransferable disk-leaks when private browsing mode is enabled by default

Categories

(Core :: Widget, defect, P2)

Firefox 91
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: pierov, Assigned: pierov)

References

Details

(Whiteboard: [tor 21830])

Attachments

(3 files)

#1123480 modified nsTransferable to prevent disk leakings when copying data in incognito mode.

However, it still leaks if private mode is enabled by default.
This happens because nsTransferable::Init is called with a nullptr context.

To confirm that this is happening, you can set browser.privatebrowsing.autostart to true, and then either add a breakpoint to DataStruct::SetData, and check its first parameter (you will notice that it is always false), or monitor in any other way the temporary files.

In Tor Browser we are using a patch developed by Neill Miller that I am attaching, and we think that all Firefox users would benefit from it.

Thanks!

The severity field is not set for this bug.
:spohl, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(spohl.mozilla.bugs)

David, do you think you could take a look and possibly get this patch reviewed, or reassign it to someone?

Severity: -- → S2
Flags: needinfo?(spohl.mozilla.bugs) → needinfo?(davidp99)
Priority: -- → P2

I'll take a look.

Flags: needinfo?(davidp99)
Assignee: nobody → davidp99

David, the patch is pretty small, can we take it?
Also, does this need to be S2?

Flags: needinfo?(davidp99)

If anyone is willing to review it and merge it you can assign it to me, too.

Pier Angelo, maybe you can submit the patch with Phabricator? It would it easier to review and land your patch.

(In reply to Marco Castelluccio [:marco] from comment #6)

Pier Angelo, maybe you can submit the patch with Phabricator? It would it easier to review and land your patch.

Sure, I was asking for a reviewer to add them in the commit subject.

r=handyman

nsTransferable was modified to prevent disk leakings when copying data
in private browsing mode with Bug 1123480.
However, the context is nullptr when it is initialized, so it sill
leaks if PBM is enabled by default.
Our solution is to check the browser.privatebrowsing.autostart in this
condition.

Attachment #9295546 - Attachment description: Bug 1768907 - nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman → Bug 1768907 - Part 2: nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman
Flags: needinfo?(davidp99)

David, thanks for the reviews!
Could you please land the patches for me? (or someone else with commit access).
Thanks!

Flags: needinfo?(davidp99)

will do!

Flags: needinfo?(davidp99)
Pushed by daparks@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65a8754a41c6
Part 1: Make browser.privatebrowsing.autostart a static pref. r=handyman,necko-reviewers
https://hg.mozilla.org/integration/autoland/rev/d12c18406020
Part 2: nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Assignee: davidp99 → pierov
See Also: → 1792055
You need to log in before you can comment on or make changes to this bug.