Skip to main content

CVE-2021-47613: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47613cvecve-2021-47613
Published: Wed Jun 19 2024 (06/19/2024, 14:58:01 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: i2c: virtio: fix completion handling The driver currently assumes that the notify callback is only received when the device is done with all the queued buffers. However, this is not true, since the notify callback could be called without any of the queued buffers being completed (for example, with virtio-pci and shared interrupts) or with only some of the buffers being completed (since the driver makes them available to the device in multiple separate virtqueue_add_sgs() calls). This can lead to incorrect data on the I2C bus or memory corruption in the guest if the device operates on buffers which are have been freed by the driver. (The WARN_ON in the driver is also triggered.) BUG kmalloc-128 (Tainted: G W ): Poison overwritten First byte 0x0 instead of 0x6b Allocated in i2cdev_ioctl_rdwr+0x9d/0x1de age=243 cpu=0 pid=28 memdup_user+0x2e/0xbd i2cdev_ioctl_rdwr+0x9d/0x1de i2cdev_ioctl+0x247/0x2ed vfs_ioctl+0x21/0x30 sys_ioctl+0xb18/0xb41 Freed in i2cdev_ioctl_rdwr+0x1bb/0x1de age=68 cpu=0 pid=28 kfree+0x1bd/0x1cc i2cdev_ioctl_rdwr+0x1bb/0x1de i2cdev_ioctl+0x247/0x2ed vfs_ioctl+0x21/0x30 sys_ioctl+0xb18/0xb41 Fix this by calling virtio_get_buf() from the notify handler like other virtio drivers and by actually waiting for all the buffers to be completed.

AI-Powered Analysis

AILast updated: 06/30/2025, 15:27:01 UTC

Technical Analysis

CVE-2021-47613 is a vulnerability identified in the Linux kernel's I2C virtio driver, which handles communication between guest virtual machines and the host via the virtio interface. The flaw arises from incorrect assumptions in the driver's completion handling logic. Specifically, the driver assumes that the notify callback is only triggered once all queued buffers have been processed by the device. However, this assumption is invalid because the notify callback can be invoked even when no buffers or only some buffers have been completed, especially in configurations using virtio-pci with shared interrupts or when buffers are submitted in multiple separate calls. This improper handling can lead to the driver freeing buffers prematurely while the device might still be operating on them. The consequence is potential data corruption on the I2C bus or memory corruption within the guest virtual machine. The vulnerability manifests as a use-after-free condition, which can cause system instability, data integrity issues, or potentially be leveraged for further exploitation within the guest environment. The fix involves modifying the notify handler to call virtio_get_buf(), ensuring that the driver waits for all buffers to be fully completed before freeing them, aligning with the behavior of other virtio drivers. This vulnerability affects Linux kernel versions identified by the given commit hashes and was publicly disclosed on June 19, 2024. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of CVE-2021-47613 can be significant in environments relying on Linux-based virtualization infrastructure, particularly those using virtio drivers for I2C device emulation within virtual machines. The vulnerability can lead to data corruption or memory corruption within guest VMs, potentially causing application failures, data loss, or system crashes. In critical infrastructure sectors such as finance, healthcare, manufacturing, and government, where Linux virtualization is prevalent, such instability could disrupt operations or compromise data integrity. Although no public exploits are known, the use-after-free nature of the bug could be leveraged by attackers with guest access to escalate privileges or execute arbitrary code within the guest, increasing the risk profile. European organizations using cloud services or private data centers with Linux virtualization should be aware of this vulnerability, as it affects the reliability and security of virtualized workloads. The impact is heightened in multi-tenant environments where isolation between guests is paramount. Additionally, the vulnerability could affect embedded Linux systems using virtio for I2C communication, which are common in industrial control systems and IoT devices deployed in Europe, potentially leading to operational disruptions.

Mitigation Recommendations

To mitigate CVE-2021-47613, European organizations should: 1) Apply the latest Linux kernel patches that address this vulnerability as soon as they become available, ensuring that the virtio I2C driver correctly handles buffer completion. 2) Audit and update virtualization infrastructure to use updated kernel versions in both host and guest systems, especially in environments running KVM/QEMU or other hypervisors relying on virtio drivers. 3) Implement strict access controls to limit guest VM capabilities and reduce the risk of exploitation from within the guest. 4) Monitor system logs for WARN_ON triggers related to the i2c virtio driver, which may indicate attempts to exploit or the presence of this bug. 5) For embedded or IoT devices using affected Linux kernels, coordinate with vendors to obtain firmware updates or patches. 6) Employ runtime memory protection mechanisms and kernel hardening features (e.g., KASLR, SMEP, SMAP) to reduce the likelihood of successful exploitation of memory corruption vulnerabilities. 7) Conduct vulnerability scanning and penetration testing focused on virtualization layers to detect potential exploitation attempts. These steps go beyond generic advice by emphasizing proactive patch management, monitoring for specific kernel warnings, and hardening virtualization environments.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-06-19T14:55:32.795Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe95cc

Added to database: 5/21/2025, 9:09:08 AM

Last enriched: 6/30/2025, 3:27:01 PM

Last updated: 7/28/2025, 3:45:09 PM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats