Opened 3 years ago

Closed 3 years ago

#18631 closed defect (fixed)

Rewritten #1517 patch for TBB/ESR45

Reported by: arthuredelstein Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: ff45-esr, TorBrowserTeam201603R
Cc: Actual Points:
Parent ID: #15197 Points:
Reviewer: Sponsor:


Our patch, "Reduce precision of time for Javascript." needed re-writing because a lot of the underlying code changed in mozilla-central. Here it is for review:

Child Tickets

Change History (5)

comment:1 Changed 3 years ago by arthuredelstein

Status: newneeds_review

Link to original ticket #1517.

comment:2 Changed 3 years ago by mcs

r=brade, r=mcs
The new patch looks okay to us.

comment:3 Changed 3 years ago by gk

Keywords: TorBrowserTeam201603R added

comment:4 Changed 3 years ago by bugzilla

replace floor() with trunc()
remove const double maxResolutionMs = 100; and add 100.0 directly into the expression (as in other places).
return static_cast<double>(mEvent->time / 100)*100; -> return static_cast<double>(mEvent->time / 100) * 100.0;

+    double now = static_cast<double>(PRMJ_Now() / PRMJ_USEC_PER_MSEC);
+    return TimeClip(floor(now/100.0)*100.0);


return TimeClip(static_cast<double>(PRMJ_Now() / (PRMJ_USEC_PER_MSEC * 100)) * 100.0); 

+ Only expose milliseconds of accuracy, since ms is the smallest time unit
for animations anyway.

If it is used to measure FPS of animations, then 1000 FPS (1 ms) is enough for all fingerprinting needs. Maybe, standard 40 ms (25 FPS) is more suitable.

+ Truncate all timers to microsecond accuracy

Is this defense too weak?

comment:5 Changed 3 years ago by gk

Keywords: ff45-esr added
Resolution: fixed
Status: needs_reviewclosed

Looks good to me as well.

Note: See TracTickets for help on using tickets.