RFR: 8329995: Restricted access to `/proc` can cause JFR initialization to crash [v2]

Erik Gahlin egahlin at openjdk.org
Mon Apr 15 13:58:44 UTC 2024


On Mon, 15 Apr 2024 13:21:01 GMT, Jaroslav Bachorik <jbachorik at openjdk.org> wrote:

>> Please, review this trivial change to make using `ProcessIterator` more robust in the presence of SELinux or a similar system.
>> 
>> The call to `os::opendir("/proc")` may return `nulltptr` if the `/proc` is not accessible due to restrictions placed by the SELinux. In that case the `ProcessIterator` will SIGSEG because it assumes the `_dir`, which is the variable storing the result  of the `os::opendir("/proc")` call to be non-null.
>> 
>> The patch is missing regression test because it is very hard to simulate `/proc` not being accessible to the test process.
>
> Jaroslav Bachorik has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add explanatory comment

Marked as reviewed by egahlin (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/18775#pullrequestreview-2001194772


More information about the hotspot-jfr-dev mailing list