[foreign-memaccess+abi] RFR: 8307461: Linker::nativeLinker should not be restricted
Jorn Vernee
jvernee at openjdk.org
Thu May 4 19:07:34 UTC 2023
On Thu, 4 May 2023 14:36:11 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> Since `Linker` is a sealed interface, we can now move restricted-ness from the static linker factory, down to the methods which are really problematic, namely `Linker::downcallHandle` and `Linker::upcallStub`.
>
> With this change, the list of restricted method looks as follows:
>
> * Linker::downcallHandle
> * Linker::upcallStub
> * MemorySegment::reinterpret
> * SymbolLookup::libraryLookup
>
> That is, crucially, restricted methods are methods that have a true risk of compromising the integrity of the Java platform. Making Linker::nativeLinker restricted casts too broad of a net, as obtaining the linker is not, per se, a dangerous or unsafe operation.
Might be nice to add testing for `upcallStub` as well to the panama_module tests
-------------
Marked as reviewed by jvernee (Committer).
PR Review: https://git.openjdk.org/panama-foreign/pull/831#pullrequestreview-1413748226
More information about the panama-dev
mailing list