
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2021-47497 affects the Linux kernel's NVMEM (Non-Volatile Memory) subsystem. The vulnerability involves a shift-out-of-bounds condition that occurs when a cell has 'nbits' equal to a multiple of BITS_PER_BYTE, leading to undefined behavior in the nvmem_shift_read_buffer_in_place function (Kernel Git).
The vulnerability occurs in drivers/nvmem/core.c where the logic '*p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0)' becomes undefined behavior. This happens because when nbits modulo BITS_PER_BYTE is 0, subtracting 1 creates a large number that is then shifted more than the number of bits that fit into an unsigned long. The issue was detected by UBSAN (Undefined Behavior Sanitizer) which reported a shift-out-of-bounds error with shift exponent 64 being too large for a 64-bit type unsigned long (NVD).
The vulnerability could lead to undefined behavior in the Linux kernel's NVMEM subsystem when reading memory cells with specific bit configurations. This primarily affects systems using NVMEM drivers for accessing non-volatile memory (Ubuntu Security).
The vulnerability was discovered during system testing with UBSAN enabled. It requires specific conditions where a memory cell's nbits value is a multiple of BITS_PER_BYTE. The issue was triggered in a test environment on Google Lazor hardware during component initialization (Kernel Git).
The issue has been fixed by adding a condition to check if there are any bits to mask out before performing the operation. The fix involves adding an if statement to verify cell->nbits % BITS_PER_BYTE before applying the GENMASK operation. The patch has been integrated into various Linux kernel versions and distributions (Kernel Git).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."