On Tue, 26 Mar 2024 21:55:38 GMT, Kevin Walls <kev...@openjdk.org> wrote:

>> Introduce the jcmd "VM.inspect" to implement access to detailed JVM object 
>> information.
>> 
>> Not recommended for live production use.  Requires UnlockDiagnosticVMOptions 
>> and not included in jcmd help output, to remind us this is not a 
>> general-purpose customer-facing tool.
>
> Kevin Walls has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Undo include

I am still feeling uneasy about this new command. I can see its potential 
usefulness, but as stated before would prefer it being limited to debug-only 
JVMs.

- jcmd can be exposed remotely, e.g., via jmx. I am not sure whether other 
solutions exist, but exposing jcmd beyond the immediate box the JVM runs on is 
something many folks want, and that is technically easy to do. So, 
customer-local solutions may exist for that, and the reach of jcmd may be 
larger than we think.
- the underlying functionality for print_location was written with debugging 
and error analysis in mind. We keep adding functionality there. I don't think 
developers adding to that function have in mind that this functionality may be 
exposed, possibly remotely.

In my opinion, UnlockDiagnosticVMOptions is not a good enough safeguard since 
it guards a whole swathe of switches that we may instruct the customer to 
enable. Once enabled, my experience is that UnlockDiagnosticVMOptions often 
lingers around. It is not unusual for customer scenarios to have set 
+UnlockDiagnosticVMOptions because of some years ago support cases.

If others feel this command is safe enough, I'll shut up and be quiet, since I 
cannot think up a concrete attack scenario.

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

PR Comment: https://git.openjdk.org/jdk/pull/17655#issuecomment-2022310874

Reply via email to