Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory safety bug with enqueueMap* #43

Open
andreasgal opened this issue Apr 6, 2016 · 1 comment
Open

memory safety bug with enqueueMap* #43

andreasgal opened this issue Apr 6, 2016 · 1 comment

Comments

@andreasgal
Copy link
Contributor

mPtr is assigned to the pointer returned by enqueue and it is then wrapped into a buffer. The buffer is returned. If the user does an enqueueUnmap*, mPtr is freed, but the buffer object might still be around, and accessing that is bad news.

To make matters worse, ArrayBuffers can be sliced and TypedArray views can be wrapped around them, and all those instances become unsafe.

No trivial fix for this, except copying, which would suck.

@mikeseven
Copy link
Owner

Yes I know, it's unsafe but I didn't want to do a copy. Maybe there is a way to detect such bad conditions.

--mike

On Wed, Apr 6, 2016 at 4:42 PM -0700, "Andreas Gal" <[email protected]mailto:[email protected]> wrote:

mPtr is assigned to the pointer returned by enqueue and it is then wrapped into a buffer. The buffer is returned. If the user does an enqueueUnmap*, mPtr is freed, but the buffer object might still be around, and accessing that is bad news.

To make matters worse, ArrayBuffers can be sliced and TypedArray views can be wrapped around them, and all those instances become unsafe.

No trivial fix for this, except copying, which would suck.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants