Latent_entropy Vulnerability in gcc-plugins

Kernel Updated 02 Oct 2025

Summary

24/04/2022
N/A
No i
Unrated
Not published

GSD-2022-1002158: gcc-plugins: latent_entropy: use /dev/urandom. Affects Kernel versions >= 38addce8b600ca335dc86fa3d48c890f1c6fa1f4, < 7a9e1327ccb27fc87c51a943270992c3250454e4. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

gcc-plugins is a collection of plugins for the GNU Compiler Collection (GCC) that provide additional functionality and analysis capabilities. These plugins can be used to enhance the compilation process and detect potential issues in the code. The latent_entropy plugin, in particular, aims to improve the entropy of random number generation in the kernel. However, a vulnerability has been discovered in the plugin that affects the way it uses the /dev/urandom device.

Vulnerability Detail

The latent_entropy plugin in gcc-plugins has a vulnerability that involves the improper use of the /dev/urandom device. Instead of using /dev/urandom for generating random numbers, the plugin uses /dev/random, which can block if the entropy pool is depleted. This can lead to delays or even denial of service in certain scenarios. The vulnerability was introduced in Linux Kernel version v4.9 and has been fixed in version v5.4.190.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If updating the Linux Kernel is not immediately feasible, a temporary workaround can be implemented by modifying the code of the latent_entropy plugin. The following code snippet demonstrates the correct usage of /dev/urandom:

#include <fcntl.h>
#include <unistd.h>

int get_random_number() {
    int fd = open("/dev/urandom", O_RDONLY);
    if (fd == -1) {
        // Handle error
    }
    int random_number;
    ssize_t bytes_read = read(fd, &random_number, sizeof(random_number));
    close(fd);
    if (bytes_read != sizeof(random_number)) {
        // Handle error
    }
    return random_number;
}

Conclusion

The latent_entropy vulnerability in the gcc-plugins collection can lead to delays or denial of service in certain scenarios due to the improper use of /dev/urandom. It is crucial to update the Linux Kernel to version v5.4.190 or later to fix this vulnerability. If immediate kernel update is not feasible, the provided workaround can be implemented to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The vulnerability in the latent_entropy plugin can result in delays or denial of service in certain scenarios. It can affect systems that rely on the plugin for random number generation, potentially impacting the overall performance and functionality of the system.

You can use the Vulert Playground at Vulert Scanner to check if your system is affected by this vulnerability. Simply upload your package-lock.json file to the playground, and it will analyze the dependencies and alert you if any vulnerabilities, including this one, are found.

Yes, the vulnerability has been fixed in Linux Kernel version v5.4.190. It is recommended to update the kernel to this version or later to address the issue.

Yes, a temporary workaround is available. You can modify the code of the latent_entropy plugin to correctly use /dev/urandom instead of /dev/random. Refer to the 'workaround' section for the code snippet and instructions.

At the time of this report, no known exploits for this vulnerability have been reported. However, it is important to address the vulnerability promptly by updating the kernel or applying the workaround to mitigate any potential risks.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback