You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I noticed an issue in two functions that, I believe, can lead to use-after-free errors due to garbage collection in some executions:
In the function caml_blake2b_init in the blake2 stubs, the variable key appears to be a string that is not registered with the garbage collector through CAMLparam. If I'm not mistaken, the allocation in the function could potentially cause the GC to move the block that stores the string, making the access in the next line potentially result in a use-after-free bug.
In the function caml_chacha20_cook_key in the chacha20 stubs a similar issue arises, I believe, with the variable counter that is an int64, not registered as a root, and then accessed after an allocation.
(I found these cases using a prototype tool that I've been working on for statically analyzing C stubs.)
The text was updated successfully, but these errors were encountered:
I think I noticed an issue in two functions that, I believe, can lead to use-after-free errors due to garbage collection in some executions:
In the function
caml_blake2b_init
in theblake2
stubs, the variablekey
appears to be a string that is not registered with the garbage collector throughCAMLparam
. If I'm not mistaken, the allocation in the function could potentially cause the GC to move the block that stores the string, making the access in the next line potentially result in a use-after-free bug.In the function
caml_chacha20_cook_key
in thechacha20
stubs a similar issue arises, I believe, with the variablecounter
that is anint64
, not registered as a root, and then accessed after an allocation.(I found these cases using a prototype tool that I've been working on for statically analyzing C stubs.)
The text was updated successfully, but these errors were encountered: