CVE-2021-47613 (GCVE-0-2021-47613)
Vulnerability from cvelistv5
Published
2024-06-19 14:58
Modified
2026-08-05 08:48
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: 3cfc88380413d20f777dc6648a38f683962e52bf
Version: 3cfc88380413d20f777dc6648a38f683962e52bf
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:47:40.505Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/9cbb957441ed8873577d7d313a3d79d69f1dad5c"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/b503de239f62eca898cfb7e820d9a35499137d22"
          }
        ],
        "title": "CVE Program Container"
      },
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47613",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-09-10T17:11:55.313991Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-09-11T17:34:50.978Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/i2c/busses/i2c-virtio.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "9cbb957441ed8873577d7d313a3d79d69f1dad5c",
              "status": "affected",
              "version": "3cfc88380413d20f777dc6648a38f683962e52bf",
              "versionType": "git"
            },
            {
              "lessThan": "b503de239f62eca898cfb7e820d9a35499137d22",
              "status": "affected",
              "version": "3cfc88380413d20f777dc6648a38f683962e52bf",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/i2c/busses/i2c-virtio.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.15"
            },
            {
              "lessThan": "5.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.10",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.16",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.10",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.16",
                  "versionStartIncluding": "5.15",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ni2c: virtio: fix completion handling\n\nThe driver currently assumes that the notify callback is only received\nwhen the device is done with all the queued buffers.\n\nHowever, this is not true, since the notify callback could be called\nwithout any of the queued buffers being completed (for example, with\nvirtio-pci and shared interrupts) or with only some of the buffers being\ncompleted (since the driver makes them available to the device in\nmultiple separate virtqueue_add_sgs() calls).\n\nThis can lead to incorrect data on the I2C bus or memory corruption in\nthe guest if the device operates on buffers which are have been freed by\nthe driver.  (The WARN_ON in the driver is also triggered.)\n\n BUG kmalloc-128 (Tainted: G        W        ): Poison overwritten\n First byte 0x0 instead of 0x6b\n Allocated in i2cdev_ioctl_rdwr+0x9d/0x1de age=243 cpu=0 pid=28\n \tmemdup_user+0x2e/0xbd\n \ti2cdev_ioctl_rdwr+0x9d/0x1de\n \ti2cdev_ioctl+0x247/0x2ed\n \tvfs_ioctl+0x21/0x30\n \tsys_ioctl+0xb18/0xb41\n Freed in i2cdev_ioctl_rdwr+0x1bb/0x1de age=68 cpu=0 pid=28\n \tkfree+0x1bd/0x1cc\n \ti2cdev_ioctl_rdwr+0x1bb/0x1de\n \ti2cdev_ioctl+0x247/0x2ed\n \tvfs_ioctl+0x21/0x30\n \tsys_ioctl+0xb18/0xb41\n\nFix this by calling virtio_get_buf() from the notify handler like other\nvirtio drivers and by actually waiting for all the buffers to be\ncompleted."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerable path is reached via local ioctl on /dev/i2c-* (i2cdev_ioctl_rdwr \u2192 i2c_transfer \u2192 virtio_i2c_xfer); it is not reachable from the network stack or remote protocols.\nAC:L - An attacker can reliably queue multiple messages in one I2C_RDWR call, each added via a separate virtqueue_add_sgs(), so a normal partial-completion notify causes the driver to free buffers while the device still uses them.\nPR:L - Triggering requires only the ability to open /dev/i2c-* and issue I2C_RDWR; i2cdev_open performs no capability checks, so group or similarly limited local access suffices.\nUI:N - The attacker triggers the bug with their own ioctl; no separate victim action is required.\nS:U - Impact is guest-kernel heap corruption within the same OS security authority; this is not a guest-to-host escape or other cross-boundary compromise.\nC:H - Premature free of virtqueue-backed buffers (reqs/out_hdr/in_hdr and I2C message data) while the device still writes them is a use-after-free that can be leveraged for arbitrary kernel memory disclosure.\nI:H - The same UAF/heap corruption (demonstrated by slab poison overwrite) enables arbitrary kernel memory modification and control-flow hijacking primitives.\nA:H - The bug causes kernel memory corruption and WARN_ON/oops paths, including the documented kmalloc poison-overwrite crash, so availability impact is high."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T08:48:37.392Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/9cbb957441ed8873577d7d313a3d79d69f1dad5c"
        },
        {
          "url": "https://git.kernel.org/stable/c/b503de239f62eca898cfb7e820d9a35499137d22"
        }
      ],
      "title": "i2c: virtio: fix completion handling",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47613",
    "datePublished": "2024-06-19T14:58:01.788Z",
    "dateReserved": "2024-06-19T14:55:32.795Z",
    "dateUpdated": "2026-08-05T08:48:37.392Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/9cbb957441ed8873577d7d313a3d79d69f1dad5c\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/b503de239f62eca898cfb7e820d9a35499137d22\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:47:40.505Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47613\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-09-10T17:11:55.313991Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-09-11T12:42:26.312Z\"}}], \"cna\": {\"title\": \"i2c: virtio: fix completion handling\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 7.8, \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - The vulnerable path is reached via local ioctl on /dev/i2c-* (i2cdev_ioctl_rdwr \\u2192 i2c_transfer \\u2192 virtio_i2c_xfer); it is not reachable from the network stack or remote protocols.\\nAC:L - An attacker can reliably queue multiple messages in one I2C_RDWR call, each added via a separate virtqueue_add_sgs(), so a normal partial-completion notify causes the driver to free buffers while the device still uses them.\\nPR:L - Triggering requires only the ability to open /dev/i2c-* and issue I2C_RDWR; i2cdev_open performs no capability checks, so group or similarly limited local access suffices.\\nUI:N - The attacker triggers the bug with their own ioctl; no separate victim action is required.\\nS:U - Impact is guest-kernel heap corruption within the same OS security authority; this is not a guest-to-host escape or other cross-boundary compromise.\\nC:H - Premature free of virtqueue-backed buffers (reqs/out_hdr/in_hdr and I2C message data) while the device still writes them is a use-after-free that can be leveraged for arbitrary kernel memory disclosure.\\nI:H - The same UAF/heap corruption (demonstrated by slab poison overwrite) enables arbitrary kernel memory modification and control-flow hijacking primitives.\\nA:H - The bug causes kernel memory corruption and WARN_ON/oops paths, including the documented kmalloc poison-overwrite crash, so availability impact is high.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"3cfc88380413d20f777dc6648a38f683962e52bf\", \"lessThan\": \"9cbb957441ed8873577d7d313a3d79d69f1dad5c\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"3cfc88380413d20f777dc6648a38f683962e52bf\", \"lessThan\": \"b503de239f62eca898cfb7e820d9a35499137d22\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/i2c/busses/i2c-virtio.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.15\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.15\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.15.10\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.15.*\"}, {\"status\": \"unaffected\", \"version\": \"5.16\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/i2c/busses/i2c-virtio.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/9cbb957441ed8873577d7d313a3d79d69f1dad5c\"}, {\"url\": \"https://git.kernel.org/stable/c/b503de239f62eca898cfb7e820d9a35499137d22\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\ni2c: virtio: fix completion handling\\n\\nThe driver currently assumes that the notify callback is only received\\nwhen the device is done with all the queued buffers.\\n\\nHowever, this is not true, since the notify callback could be called\\nwithout any of the queued buffers being completed (for example, with\\nvirtio-pci and shared interrupts) or with only some of the buffers being\\ncompleted (since the driver makes them available to the device in\\nmultiple separate virtqueue_add_sgs() calls).\\n\\nThis can lead to incorrect data on the I2C bus or memory corruption in\\nthe guest if the device operates on buffers which are have been freed by\\nthe driver.  (The WARN_ON in the driver is also triggered.)\\n\\n BUG kmalloc-128 (Tainted: G        W        ): Poison overwritten\\n First byte 0x0 instead of 0x6b\\n Allocated in i2cdev_ioctl_rdwr+0x9d/0x1de age=243 cpu=0 pid=28\\n \\tmemdup_user+0x2e/0xbd\\n \\ti2cdev_ioctl_rdwr+0x9d/0x1de\\n \\ti2cdev_ioctl+0x247/0x2ed\\n \\tvfs_ioctl+0x21/0x30\\n \\tsys_ioctl+0xb18/0xb41\\n Freed in i2cdev_ioctl_rdwr+0x1bb/0x1de age=68 cpu=0 pid=28\\n \\tkfree+0x1bd/0x1cc\\n \\ti2cdev_ioctl_rdwr+0x1bb/0x1de\\n \\ti2cdev_ioctl+0x247/0x2ed\\n \\tvfs_ioctl+0x21/0x30\\n \\tsys_ioctl+0xb18/0xb41\\n\\nFix this by calling virtio_get_buf() from the notify handler like other\\nvirtio drivers and by actually waiting for all the buffers to be\\ncompleted.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15.10\", \"versionStartIncluding\": \"5.15\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.16\", \"versionStartIncluding\": \"5.15\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T08:48:37.392Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2021-47613\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T08:48:37.392Z\", \"dateReserved\": \"2024-06-19T14:55:32.795Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-06-19T14:58:01.788Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…