-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
buffer: use-after-free when deleting buffer.parent #5378
Comments
@bnoordhuis the syntax Also, I don't understand how this is unexpected. The only reference v8 has to keep the SlowBuffer alive is the |
No, that's only to make it easier to demonstrate the issue.
It's not unexpected but 'not unexpected' doesn't imply 'not a bug.' |
Alright. Understand now. So it is technically a bug that when Solutions are to make it This ticket might be open for a while, but I'll keep it in mind as the v8 api performance improves in these related areas. There is one other possibility that we may want to consider. Currently Currently I'm looking into a way to allow |
Fixed by 3a2f273. |
Fwiw this could still happen if a user overrides the parent attribute when the buffer is specifically from a slice. |
Okay. Reopen if you think it's worth fixing (and possible to fix.) |
It is possible, but right now not without a nontrivial performance regression. I'll continue to investigate a better way. |
@trevnorris Any news? |
We take the performance hit of attaching this internally or leave as is. Imo it's important we save all the time we can, because as of a recent v8 |
@bnoordhuis this isn't going to be fixed any time soon. Either adding the attribute in C++ and making it READONLY or using |
Just an update. This will be fixed if we move |
@trevnorris @vkurchatkin ... is this still an issue? |
@jasnell Yes. The only two solutions are to either make the |
Ok, leaving a reference to nodejs/node#1810 here. Can hopefully close this once that lands. |
nodejs/node#1810 closed. Will pick up the solution in the converged repo. Possibly could investigate a backport. |
Deleting the .parent property on a Buffer instance may cause a use-after-free error when the buffer is later indexed into.
The text was updated successfully, but these errors were encountered: