-
Notifications
You must be signed in to change notification settings - Fork 257
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
Violations of pointer passing rules #584
Comments
Fixing this should largely just be a matter of allocating C-memory and storing C-pointers into our structs right? |
Also, do you have any thoughts on why this wasn't caught by the stricter checking we enable with the env var? |
Right. Or allocating the whole struct in C memory, if that is easier.
I think the checker can not do anything in this case, because it only can observe, what is passed to C, which is legal in this case. But it can't really check, what the C code is doing with the pointers. So we always have to be aware of that, to make sure, no ceph API is storing some pointers we are passing to it. |
Isn't the byte buffer Lines 25 to 28 in 87f4563
|
Yes, indeed. Thanks! Here we might use PtrGuard to break the rules. Else we need to copy the data. |
Do you have any ETA on this please, so that I can continue with PRs? |
At least at one place we hand over Go pointers to the Ceph API that gonna get stored in a handler registry after the call returns, which violates the pointer passing rules:
go-ceph/rados/read_op.go
Lines 80 to 81 in 312e4cf
So there is no guarantee that the pointers remain valid.
With the iterator right before:
go-ceph/rados/read_op.go
Line 79 in 312e4cf
we are safe, since - as far as I can tell - it doesn't get stored anywhere.
The text was updated successfully, but these errors were encountered: