Reduced test case is in the patch, and is most of the failures on the Stanford Crypto Library test suite. The bug is in the integer overflow path for ADD, SUB, and MUL. Sometimes the result register overlaps with an input data register. To rematerialize the input, a load is required. However it used frame.addressOf(), which really must be used with extreme care when loads are involved. It will return the raw address of a copy, rather than following the copy to its backing store. The copy was not synced, so it was reading garbage. This affected a few other uses of addressOf() as well. The attached patch introduces a version that follows copies and asserts a sync()'d state.
Created attachment 468212 [details] [diff] [review] fix
Created attachment 468241 [details] [diff] [review] fix v2 SJCL tests pass with this.
Created attachment 468328 [details] [diff] [review] fix v2, correct patch
Comment on attachment 468328 [details] [diff] [review] fix v2, correct patch Thanks for the excellent explanation of the cause and the workings of the fix!
Attachment #468328 - Flags: review?(dmandelin) → review+
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.