mtd: Require Write Permissions for Locking and Badblock IOCTLs

Kernel Updated 02 Oct 2025

Summary

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

GSD-2021-1000436: mtd: require write permissions for locking and badblock ioctls. Affects Kernel versions >= 9a53e8bd59d9f070505e51d3fd19606a270e6b93, < 5880afefe0cb9b2d5e801816acd58bfe91a96981. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The Kernel package in the Linux ecosystem is responsible for managing the core functionality of the operating system. It provides essential services and interfaces for hardware, software, and user applications. The Memory Technology Devices (MTD) subsystem within the Kernel handles the management of flash memory devices. It allows for the abstraction of various flash devices and provides a unified interface for accessing them.

One of the features provided by the MTD subsystem is the ability to lock and mark bad blocks on flash devices. These operations are crucial for maintaining data integrity and preventing further degradation of the flash memory.

However, a vulnerability has been discovered in the MTD subsystem that allows these locking and badblock operations to be performed without requiring write permissions. This means that an attacker with read-only access to the flash device can still modify its state, potentially leading to data corruption or other security issues.

Vulnerability Detail

The vulnerability in the MTD subsystem arises from the lack of proper permission checks for locking and badblock IOCTLs. These IOCTLs allow users to perform operations such as locking a block to prevent further writes or marking a block as bad to exclude it from future use.

By not enforcing write permissions for these IOCTLs, an attacker with read-only access to the flash device can still issue these commands and modify the device's state. This can lead to data corruption, loss of data integrity, or even unauthorized modification of critical system files stored on the flash device.

The vulnerability was introduced in version v5.4.58 of the Linux Kernel and has been fixed in version v5.4.119.

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 a workaround, users can manually modify the permissions of the flash device to restrict write access. This can be done by adjusting the file system permissions or using access control mechanisms provided by the operating system.

However, it is important to note that this workaround may have limitations and may not provide complete protection against the vulnerability. It is strongly recommended to apply the official fix by updating the Linux Kernel to the latest version.

Conclusion

The vulnerability in the MTD subsystem of the Linux Kernel allows read-only users to perform write operations on flash devices without proper permission checks. This can lead to data corruption, loss of data integrity, or unauthorized modification of critical system files. It is recommended to update the Linux Kernel to version v5.4.119 or later to fix this vulnerability. Modifying the flash device permissions can serve as a temporary workaround, but it is important to apply the official fix to ensure complete protection.

For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for Kernel →

Share this vulnerability

FAQ

The vulnerability allows an attacker with read-only access to a flash device to perform write operations, potentially leading to data corruption, loss of data integrity, or unauthorized modification of critical system files.

You can use tools like Vulert (https://vulert.com) to check if your system is affected by this vulnerability. Vulert uses a manifest file like package-lock.json to monitor and alert in real-time for open-source vulnerabilities in the software. You can also use the Vulert playground (https://vulert.com/scanner) without any signup to check if your application is affected.

At the time of this report, there are no known public exploits for this vulnerability. However, it is important to apply the fix as soon as possible to mitigate the risk.

No, this vulnerability requires local access to the flash device. However, it is still important to address the vulnerability to prevent potential attacks from insiders or unauthorized physical access to the system.

The recommended workaround is to update the Linux Kernel to the latest version. Modifying the flash device permissions is an additional measure that can be taken, but it may not provide complete protection against the vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for Kernel.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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