The vulnerability is a denial-of-service in the opentelemetry-ebpf-profiler agent. The root cause is the agent's handling of file openings when profiling processes. The agent needs to read ELF files and other process-related files. An unprivileged malicious process can create a named pipe (FIFO) at a location where the profiler agent expects to find a regular file. When the agent attempts to open this FIFO using standard functions like os.Open or unix.Stat, the operation blocks indefinitely because the malicious process never writes to the pipe. This blocks the agent's goroutine, preventing it from profiling any further processes.
The patch addresses this by replacing the blocking file-opening mechanisms with the openat2 syscall, which is available in Linux kernels 5.6 and later. The fix introduces a new openInRoot function that uses openat2 with specific flags (O_PATH, RESOLVE_IN_ROOT, RESOLVE_NO_MAGICLINKS) to open a file path without blocking on special files like FIFOs. It then uses fstat to verify that the opened file is a regular, non-empty file before proceeding. The functions responsible for file access (OpenMappingFile, GetMappingFileLastModified, CalculateMappingFileID, OpenELF) were all modified to use this new, safer file-opening logic, thus preventing the denial-of-service.