Make fdlibm (sin/cos/tan) fingerprinting resistance precise
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: tschuster, Assigned: tschuster)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files)
Right now we just globally switch between the plaform libm or fdlibm with JS::SetUseFdlibmForSinCosTan. Maybe there are already plans for switching to fdlibm by default? Or maybe we decide that using fdlibm is good enough when RFP (lite?) is enabled.
Making this per realm might again involve some amount of work, because it seems like the various js::math_cos_impl
functions don't receive any kind of context.
Comment 1•2 years ago
|
||
(In reply to Tom Schuster (MoCo) from comment #0)
Maybe there are already plans for switching to fdlibm by default?
We don't use fdlibm's implementation for sin/cos/tan, because it's too slow (see bug 933257). V8 also recently switched their implementation from fdlibm to glibc to improve the performance of sin/cos: https://bugs.chromium.org/p/v8/issues/detail?id=13477.
Comment 2•2 years ago
|
||
Don't we have the JSContext right above the _impl function calls? I'm probably missing some other callpath.
In any event, I don't think this is something we need to make precise. I think if RFP or RFP Lite is enabled, we can use fdlibm; and for RFPLite we can make a RFPTarget that would allow us to remove it from RFPLite if necessary. Removing it from RFPLite via Bug 1824222 would require some special handling over there, but should be doable.
Assignee | ||
Comment 3•2 years ago
|
||
I think at least here we don't have the context, but I haven't traced out the call path yet.
In any event, I don't think this is something we need to make precise. I think if RFP or RFP Lite is enabled, we can use fdlibm; and for RFPLite we can make a RFPTarget that would allow us to remove it from RFPLite if necessary. Removing it from RFPLite via Bug 1824222 would require some special handling over there, but should be doable.
Sounds good. I agree that a slightly slower math function is not a problem we need to solve soon.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Making fdlibm togglable individually and not just based on general RFP state would require some additional plumbing similar to RealmBehaviors::clampAndJitterTime
. I am not sure how useful that is. I think the fdlibm and native implementations only differ in some edge cases, so the potential for compatibility issues seems low.
Assignee | ||
Comment 5•2 years ago
|
||
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D174264
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D174265
Assignee | ||
Comment 8•2 years ago
|
||
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D174266
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Comment 11•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6ae27d2b4eff
https://hg.mozilla.org/mozilla-central/rev/9b5be2492da3
https://hg.mozilla.org/mozilla-central/rev/64636336485c
https://hg.mozilla.org/mozilla-central/rev/c08b278ee06e
Description
•