Shift-Out-of-Bound Vulnerability in nvmem Package
Summary
GSD-2021-1001998: nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells. Affects Kernel versions >= 69aba7948cbe53f2f1827e84e9dd0ae470a5072e, < 0594f1d048d8dc338eb9a240021b1d00ae1eb082. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The nvmem package is a component of the Linux Kernel ecosystem. It provides an interface for accessing non-volatile memory devices. Non-volatile memory (NVM) is a type of computer memory that retains its data even when power is turned off or lost. The nvmem package allows applications to read from and write to NVM devices, enabling persistent storage of data. However, a vulnerability has been discovered in the nvmem package that can lead to a shift-out-of-bound error when byte size cells are used.
Vulnerability Detail
The shift-out-of-bound vulnerability in the nvmem package occurs when byte size cells are accessed. This vulnerability was introduced in version v4.3 of the Linux Kernel by commit 69aba7948cbe53f2f1827e84e9dd0ae470a5072e and affects all subsequent versions until it was fixed in version v5.4.155 by commit 0594f1d048d8dc338eb9a240021b1d00ae1eb082. The vulnerability can result in undefined behavior and potential security risks. An attacker may be able to exploit this vulnerability to gain unauthorized access, modify data, or execute arbitrary code.
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 kernel is not immediately feasible, a temporary workaround can be implemented by avoiding the use of byte size cells in nvmem operations. Instead, use larger cell sizes to prevent the shift-out-of-bound error. Here is an example of how to specify a cell size of 4 bytes:
struct nvmem_cell_info cell_info = {
.name = "my_cell",
.size = 4,
};
Conclusion
The shift-out-of-bound vulnerability in the nvmem package can have serious security implications. It is crucial to update the Linux Kernel to the fixed version or apply the provided workaround to mitigate the risk. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability can lead to undefined behavior and potential security risks. Attackers may exploit this vulnerability to gain unauthorized access, modify data, or execute arbitrary code.
The vulnerability was introduced in version v4.3 of the Linux Kernel and affects all subsequent versions until it was fixed in version v5.4.155.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for any open-source vulnerabilities, including this one.
Yes, a temporary workaround is to avoid using byte size cells in nvmem operations. Instead, use larger cell sizes to prevent the shift-out-of-bound error. Refer to the 'workaround' section for an example.
To fix this vulnerability, update the Linux Kernel to version v5.4.155 or later. Pull the latest changes from the official Linux Kernel repository and recompile/install the updated kernel on the affected system.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.