On Wed, 31 May 2023 10:08:46 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:

> The VM option EnableDynamicAgentLoading was added in JDK 9, default true, to 
> allow deployment to choose whether to allow agents to be loaded/started in 
> the VM. The VM option does the right thing for tools using the Attach API but 
> jcmd JVMTI.agent_load was missed. This should be fixed to disallow loading 
> JVMTI agents when the EnableDynamicAgentLoading is false.
> 
> Testing:
>  - run new test `test/jdk/sun/tools/jcmd/TestJcmdNoAgentLoad.java`
>  - TBD: submit mach5 tiers 1-5 to make sure no new regressions are introduced

For the "load" command implemented in attachLister, do you remember why 
EnableDynamicAgentLoading is checked in attach_listener_thread_entry? Looking 
at it now, I wonder why the check isn't in load_agent. The code in 
attach_listener_thread_entry shouldn't have to special-case commands.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14244#issuecomment-1569932102

Reply via email to