-
Enhancement
-
Resolution: Fixed
-
P3
-
9
-
None
-
b89
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142847 | emb-9 | Attila Szegedi | P3 | Resolved | Fixed | team |
Dynalink used to auto-discover GuardingDynamicLinker classes declared through the java.util.ServiceLoader mechanism. However, such automatically exported GuardingDynamicLinker is a trusted object as it can affect linking of call sites external to itself (in the language runtime that auto-loaded it).
Hence, we decided on another level of indirection, namely Dynalink should instead look for instances of GuardingDynamicLinkerExporter through the service loader mechanism. GuardingDynamicLinkerExporter is an abstract class that performs a permission check in its constructor. Libraries can export linkers only through their instances of their own subclass of GuardingDynamicLinkerExporter, which will then trigger the permission check. Hence, only libraries explicitly granted the permission to export linkers will be able to do so.
Hence, we decided on another level of indirection, namely Dynalink should instead look for instances of GuardingDynamicLinkerExporter through the service loader mechanism. GuardingDynamicLinkerExporter is an abstract class that performs a permission check in its constructor. Libraries can export linkers only through their instances of their own subclass of GuardingDynamicLinkerExporter, which will then trigger the permission check. Hence, only libraries explicitly granted the permission to export linkers will be able to do so.
- backported by
-
JDK-8142847 Introduce GuardingDynamicLinkerExporter
-
- Resolved
-