This repository was archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
AtomicReadModifyWrite is not checking shrunk ArrayBuffer after ToIntegerOrInfinity #104
Comments
Also, this can be applied to |
|
Thanks, yep, that sounds right to me. Looks to me like those IsDetached calls need to be replaced with IsIntegerIndexedObjectOutOfBounds. Correction: IsIntegerIndexedObjectOutOfBounds isn't sufficient, we also need to recheck the index < length. |
syg
added a commit
that referenced
this issue
Nov 17, 2022
syg
added a commit
that referenced
this issue
Dec 3, 2022
syg
added a commit
that referenced
this issue
Dec 3, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now, AtomicReadModifyWrite is only checking detached buffer after
[ToIntegerOrInfinity](https://tc39.es/ecma262/#sec-tointegerorinfinity)
. This means that, if shrinking happens via this toIntegerOrInfinity, then indexedPosition can be out-of-bounds in non-shared ArrayBuffer.Note that Atomics RMW operations can be performed onto non-shared ArrayBuffer-backing TypedArrays. (While notify / wait etc. works only for SharedArrayBuffer-backing TypedArrays). Thus, shrinking can happen via
resize
method.Also, note that ValidateAtomicAccess happens before performing
ToIntegerOrInfinity
, so we need yet another check basically.https://tc39.es/ecma262/#sec-atomicreadmodifywrite
The text was updated successfully, but these errors were encountered: