Use-after-free vulnerability in spi package

Kernel Updated 02 Oct 2025

Summary

31/05/2021
N/A
No i
Unrated
Not published

GSD-2021-1000431: spi: Fix use-after-free with devm_spi_alloc_*. Affects Kernel versions >= 3e04a4976addbedcad326f47b0dd4efc570a1fac, < 001c8e83646ad3b847b18f6ac55a54367d917d74. 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

The spi package is a component of the Linux Kernel that provides support for Serial Peripheral Interface (SPI) devices. SPI is a synchronous serial communication interface commonly used for connecting microcontrollers, sensors, and other peripheral devices to a central processing unit (CPU). The spi package allows the kernel to communicate with SPI devices by providing APIs and drivers. However, a use-after-free vulnerability has been discovered in the spi package, which can lead to potential security issues.

Vulnerability Detail

The use-after-free vulnerability in the spi package occurs when the devm_spi_alloc_* functions are used. These functions allocate memory for a SPI device and register it with the kernel, but they do not properly handle the deallocation of the memory when the device is released. This can result in a situation where the memory is freed, but a reference to it is still held, leading to a use-after-free condition. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service (DoS) condition.

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

There is no known workaround for this vulnerability. It is recommended to apply the fix by updating the Linux Kernel.

Conclusion

The use-after-free vulnerability in the spi package of the Linux Kernel can lead to potential security issues, including arbitrary code execution and denial-of-service. It is crucial to update the kernel to version v5.4.119 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The spi package is a component of the Linux Kernel that provides support for Serial Peripheral Interface (SPI) devices.

A use-after-free vulnerability occurs when a program or system continues to use a memory address after it has been freed, leading to potential security issues.

This vulnerability can potentially allow an attacker to execute arbitrary code or cause a denial-of-service (DoS) condition.

To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.4.119 or later.

There is no known workaround for this vulnerability. It is recommended to apply the fix by updating the Linux Kernel.

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