Hash the XDR transcode buffer
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
People
(Reporter: tcampbell, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(3 obsolete files)
Since the XDR data integrity of startup caches is important to avoid crashes, we should add a hash check on decode.
One concern would be disk read, but the hash is per transcode operation which are done as a chunk and would quickly hit the same disk latency anyways. The startup caches perform several transcode operations so the hash does not span the whole file. The worst case I see is the activity-stream bundle which is a 750kB buffer.
This also lumps the first-access of the data in one place which might be useful if we wanted to have a signal handling to catch mmap errors. See Bug 1444442.
| Reporter | ||
Comment 1•6 years ago
|
||
| Reporter | ||
Comment 2•6 years ago
|
||
Depends on D29551
| Reporter | ||
Comment 3•6 years ago
|
||
Compute and verify the SHA1 hash of each XDR transcode operation. This
is to detect data corruption issues that will otherwise lead to serious
crashes.
Depends on D29552
Comment 4•6 years ago
•
|
||
Stupid question, any reason to use SHA1, and not a cheaper / faster-to-compute hashing / check-sum algorithm?
| Reporter | ||
Comment 5•6 years ago
|
||
The silly reason was that it was available in MFBT. There are several CRC implementations in tree but not in JS so SHA1 was the easiest to get. Several of the CRC implementations are not very efficient either. A number of those CRC implementations are byte-based and naive as well. It is probably worth replacing the SHA1 before landing so no reviewers have been assigned yet.
Updated•6 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
| Reporter | ||
Updated•4 years ago
|
Updated•3 years ago
|
Description
•