Vulnerability in Kernel: soc: bcm: Check for NULL return of devm_kzalloc()

Kernel Updated 02 Oct 2025

Summary

28/06/2022
N/A
No i
Unrated
Not published

GSD-2022-1002719: soc: bcm: Check for NULL return of devm_kzalloc(). Affects Kernel versions >= 8bcac4011ebe0dbdd46fd55b036ee855c95702d3, < b48b98743b568bb219152ba2e15af6ef0d3d8a9b. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Kernel is a critical component of the Linux operating system that provides core functionalities and acts as an interface between hardware and software. It is responsible for managing system resources, handling device drivers, and facilitating communication between different software components. The soc: bcm module within the Kernel is specifically related to Broadcom System-on-Chip (SoC) devices. These devices are commonly used in various electronic devices, including routers, switches, and IoT devices. The soc: bcm module provides support for the functionality and drivers required for these Broadcom SoC devices to operate effectively within the Linux environment.

Vulnerability Detail

The vulnerability identified in the soc: bcm module is related to the improper handling of memory allocation. Specifically, the code does not check for a NULL return value when using the devm_kzalloc() function. This function is responsible for allocating memory with automatic cleanup upon device removal. If the devm_kzalloc() function fails to allocate memory and returns NULL, subsequent operations relying on this memory allocation can lead to unexpected behavior, including crashes, data corruption, or potential security vulnerabilities. The impact and attack plausibility of this vulnerability have not been proven yet, but it is essential to address it to ensure the stability and security of systems utilizing Broadcom SoC devices.

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

As this vulnerability is addressed in the latest Kernel version, the recommended approach is to update the Kernel. However, if immediate Kernel update is not feasible, a temporary workaround can be implemented by modifying the code to manually check for the NULL return of devm_kzalloc() and handle it appropriately. Here is an example of how this can be done:

/* Original code */
ptr = devm_kzalloc(dev, size, GFP_KERNEL);

/* Workaround code */
ptr = devm_kzalloc(dev, size, GFP_KERNEL);
if (!ptr) {
    /* Handle NULL return appropriately */
}

It is important to note that workarounds may introduce additional complexities and should only be considered as temporary measures until the Kernel can be updated.

Conclusion

The vulnerability in the soc: bcm module of the Kernel, related to the improper handling of memory allocation, can lead to unexpected behavior, crashes, data corruption, or potential security vulnerabilities. It is crucial to update the Kernel to version v5.18.3 or later to address this vulnerability. In the meantime, a temporary workaround can be implemented by manually checking for the NULL return of devm_kzalloc() and handling it appropriately. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The Kernel is a critical component of the Linux operating system that provides core functionalities and acts as an interface between hardware and software.

The soc: bcm module within the Kernel is specifically related to Broadcom System-on-Chip (SoC) devices. These devices are commonly used in various electronic devices, including routers, switches, and IoT devices.

devm_kzalloc() is a function in the Linux Kernel that is responsible for allocating memory with automatic cleanup upon device removal.

The potential risks of this vulnerability include crashes, data corruption, or potential security vulnerabilities due to unexpected behavior resulting from improper memory allocation.

To fix this vulnerability, it is necessary to update the Linux Kernel to version v5.18.3 or later, which includes the fix for this issue.

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