From a92ad03946d296510c8c2ac18278608e8032b3f3 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Tue, 23 Apr 2024 12:14:57 +0000 Subject: [PATCH] 8329995: Restricted access to `/proc` can cause JFR initialization to crash Reviewed-by: dholmes, egahlin --- src/hotspot/os/linux/os_perf_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/os/linux/os_perf_linux.cpp b/src/hotspot/os/linux/os_perf_linux.cpp index cca41a12ee1..87abbebe25f 100644 --- a/src/hotspot/os/linux/os_perf_linux.cpp +++ b/src/hotspot/os/linux/os_perf_linux.cpp @@ -847,7 +847,7 @@ SystemProcessInterface::SystemProcesses::ProcessIterator::ProcessIterator() { bool SystemProcessInterface::SystemProcesses::ProcessIterator::initialize() { _dir = os::opendir("/proc"); _entry = nullptr; - _valid = true; + _valid = _dir != nullptr; // May be null if /proc is not accessible. next_process(); return true;