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
isa cache leaks into and out of Safe compartments #8537
Comments
From perlbug@plan9.deCreated by perlbug@plan9.dePerl's ISA cache (used e.g. for method lookups) leaks into and out of Safe Example environment: $obj is blessed into "pkg", which has method "method" outside the Safe Example of leaking into the compartment: The following succeeds *within* the compartment when "method" has $obj->method # call cached method outside of Safe Example of leaking out of Safe compartment: The following code executed *within* the compartment will add a $obj->method # invalidate method for following calls outside of Safe Workaround: I manually nuked the isa cache of all (for me) relevant classes before and delete *{"main::$_\::"}{HASH}{"::ISA::CACHE::"}; Solution: The only solution to this problem (apart from documenting it it and I think this is a serious problem with Safe (especially as it is not Perl Info
|
From schmorp@schmorp.deSorry, mny original report is not the full (or true story). The culprit seems to be the method cache that gv_fetchmethod manages. When passing objects into the Safe compartment, they retain a pointer to the The first case gives Safe access to outside methods, the second case lets it -- |
The RT System itself - Status changed from 'new' to 'open' |
From @rgsperlbug@plan9.de (via RT) wrote:
One (or several) test cases would be helpful. I haven't tried to reproduce the bug, but a patch based on this idea --- ext/Opcode/Opcode.xs + /* Invalidate ISA and method caches */ |
From @rgarciaOn 08/08/06, Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> wrote:
I applied this modification as change #28797 to bleadperl. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#39887 (status was 'resolved')
Searchable as RT39887$
The text was updated successfully, but these errors were encountered: