-
Notifications
You must be signed in to change notification settings - Fork 8
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
Unsoundness in SIF due to encoding of object allocation #152
Comments
Thanks for filing the issue! I'm discussing this problem in the final version of the thesis, of course. For the implementation, I'm not yet sure what's the best solution. We could, as you suggest, either treat new allocations as low if all previous low allocations were low events, but that would require new specifications to be modular, or just enforce that all allocations are low events, which would be quite restrictive. An alternative that I'm currently leaning toward is this: The encoding we use is sound only if the actual addresses of objects are never visible, i.e., cannot be inspected except for equality with other references. This is the case throughout most of Python (which is why we're using that encoding), but as you show, the default implementation of str is an exception and leaks the actual address value. So instead of changing the encoding of allocation, we could (in general) treat the output of object.str as high, since it gives access to values that we don't want to be visible, and do the same with any other built-in methods that leak address information. |
That's a really nice solution (treating the output of "str" as high by default since it exposes address information). I'm not sure if there are other places in Python that would expose address information that would also need to be treated as "high". Thanks for looking into this and well done again on your thesis. I'm looking forward to pointing my students toward it once the final version is published |
Finally fixed in PR #155 |
The modular product program encoding assumes that any object allocation reached in both executions produces an object reference that is low. However real allocators don’t behave that way: allocation decisions depend on what previous allocations have occurred. The following example demonstrates this potential unsoundness in current Nagini:
Nagini verifies this correctly (using command line
nagini –sif true
). Yet on my machine, the first allocation always yields an object whose least significant 8 bits of the address exposed in itsstr
is “c0” while for the second allocation these bits are reliably “60” instead.The text was updated successfully, but these errors were encountered: