CVE-2025-40048 (GCVE-0-2025-40048)
Vulnerability from cvelistv5
Published
2025-10-28 11:48
Modified
2025-10-29 13:19
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: uio_hv_generic: Let userspace take care of interrupt mask Remove the logic to set interrupt mask by default in uio_hv_generic driver as the interrupt mask value is supposed to be controlled completely by the user space. If the mask bit gets changed by the driver, concurrently with user mode operating on the ring, the mask bit may be set when it is supposed to be clear, and the user-mode driver will miss an interrupt which will cause a hang. For eg- when the driver sets inbound ring buffer interrupt mask to 1, the host does not interrupt the guest on the UIO VMBus channel. However, setting the mask does not prevent the host from putting a message in the inbound ring buffer. So let’s assume that happens, the host puts a message into the ring buffer but does not interrupt. Subsequently, the user space code in the guest sets the inbound ring buffer interrupt mask to 0, saying “Hey, I’m ready for interrupts”. User space code then calls pread() to wait for an interrupt. Then one of two things happens: * The host never sends another message. So the pread() waits forever. * The host does send another message. But because there’s already a message in the ring buffer, it doesn’t generate an interrupt. This is the correct behavior, because the host should only send an interrupt when the inbound ring buffer transitions from empty to not-empty. Adding an additional message to a ring buffer that is not empty is not supposed to generate an interrupt on the guest. Since the guest is waiting in pread() and not removing messages from the ring buffer, the pread() waits forever. This could be easily reproduced in hv_fcopy_uio_daemon if we delay setting interrupt mask to 0. Similarly if hv_uio_channel_cb() sets the interrupt_mask to 1, there’s a race condition. Once user space empties the inbound ring buffer, but before user space sets interrupt_mask to 0, the host could put another message in the ring buffer but it wouldn’t interrupt. Then the next pread() would hang. Fix these by removing all instances where interrupt_mask is changed, while keeping the one in set_event() unchanged to enable userspace control the interrupt mask by writing 0/1 to /dev/uioX.
Impacted products
Vendor Product Version
Linux Linux Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Version: 95096f2fbd10186d3e78a328b327afc71428f65f
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/uio/uio_hv_generic.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "540aac117eaea5723cef5e4cbf3035c4ac654d92",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "65d40acd911c7011745cbbd2aaac34eb5266d11e",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "a44f61f878f32071d6378e8dd7c2d47f9490c8f7",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "01ce972e6f9974a7c76943bcb7e93746917db83a",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "2af39ab5e6dc46b835a52e80a22d0cad430985e3",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "37bd91f22794dc05436130d6983302cb90ecfe7e",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "e29587c07537929684faa365027f4b0d87521e1b",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            },
            {
              "lessThan": "b15b7d2a1b09ef5428a8db260251897405a19496",
              "status": "affected",
              "version": "95096f2fbd10186d3e78a328b327afc71428f65f",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/uio/uio_hv_generic.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "4.10"
            },
            {
              "lessThan": "4.10",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.301",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.246",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.195",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.156",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.112",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.53",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18-rc1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.301",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.246",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.195",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.156",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.112",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.53",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.3",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18-rc1",
                  "versionStartIncluding": "4.10",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nuio_hv_generic: Let userspace take care of interrupt mask\n\nRemove the logic to set interrupt mask by default in uio_hv_generic\ndriver as the interrupt mask value is supposed to be controlled\ncompletely by the user space. If the mask bit gets changed\nby the driver, concurrently with user mode operating on the ring,\nthe mask bit may be set when it is supposed to be clear, and the\nuser-mode driver will miss an interrupt which will cause a hang.\n\nFor eg- when the driver sets inbound ring buffer interrupt mask to 1,\nthe host does not interrupt the guest on the UIO VMBus channel.\nHowever, setting the mask does not prevent the host from putting a\nmessage in the inbound ring buffer.\u00a0So let\u2019s assume that happens,\nthe host puts a message into the ring buffer but does not interrupt.\n\nSubsequently, the user space code in the guest sets the inbound ring\nbuffer interrupt mask to 0, saying \u201cHey, I\u2019m ready for interrupts\u201d.\nUser space code then calls pread() to wait for an interrupt.\nThen one of two things happens:\n\n* The host never sends another message. So the pread() waits forever.\n* The host does send another message. But because there\u2019s already a\n  message in the ring buffer, it doesn\u2019t generate an interrupt.\n  This is the correct behavior, because the host should only send an\n  interrupt when the inbound ring buffer transitions from empty to\n  not-empty. Adding an additional message to a ring buffer that is not\n  empty is not supposed to generate an interrupt on the guest.\n  Since the guest is waiting in pread() and not removing messages from\n  the ring buffer, the pread() waits forever.\n\nThis could be easily reproduced in hv_fcopy_uio_daemon if we delay\nsetting interrupt mask to 0.\n\nSimilarly if hv_uio_channel_cb() sets the interrupt_mask to 1,\nthere\u2019s a race condition. Once user space empties the inbound ring\nbuffer, but before user space sets interrupt_mask to 0, the host could\nput another message in the ring buffer but it wouldn\u2019t interrupt.\nThen the next pread() would hang.\n\nFix these by removing all instances where interrupt_mask is changed,\nwhile keeping the one in set_event() unchanged to enable userspace\ncontrol the interrupt mask by writing 0/1 to /dev/uioX."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-10-29T13:19:47.795Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/540aac117eaea5723cef5e4cbf3035c4ac654d92"
        },
        {
          "url": "https://git.kernel.org/stable/c/65d40acd911c7011745cbbd2aaac34eb5266d11e"
        },
        {
          "url": "https://git.kernel.org/stable/c/a44f61f878f32071d6378e8dd7c2d47f9490c8f7"
        },
        {
          "url": "https://git.kernel.org/stable/c/01ce972e6f9974a7c76943bcb7e93746917db83a"
        },
        {
          "url": "https://git.kernel.org/stable/c/2af39ab5e6dc46b835a52e80a22d0cad430985e3"
        },
        {
          "url": "https://git.kernel.org/stable/c/37bd91f22794dc05436130d6983302cb90ecfe7e"
        },
        {
          "url": "https://git.kernel.org/stable/c/e29587c07537929684faa365027f4b0d87521e1b"
        },
        {
          "url": "https://git.kernel.org/stable/c/b15b7d2a1b09ef5428a8db260251897405a19496"
        }
      ],
      "title": "uio_hv_generic: Let userspace take care of interrupt mask",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40048",
    "datePublished": "2025-10-28T11:48:25.220Z",
    "dateReserved": "2025-04-16T07:20:57.156Z",
    "dateUpdated": "2025-10-29T13:19:47.795Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40048\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-10-28T12:15:38.920\",\"lastModified\":\"2025-10-30T15:05:32.197\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nuio_hv_generic: Let userspace take care of interrupt mask\\n\\nRemove the logic to set interrupt mask by default in uio_hv_generic\\ndriver as the interrupt mask value is supposed to be controlled\\ncompletely by the user space. If the mask bit gets changed\\nby the driver, concurrently with user mode operating on the ring,\\nthe mask bit may be set when it is supposed to be clear, and the\\nuser-mode driver will miss an interrupt which will cause a hang.\\n\\nFor eg- when the driver sets inbound ring buffer interrupt mask to 1,\\nthe host does not interrupt the guest on the UIO VMBus channel.\\nHowever, setting the mask does not prevent the host from putting a\\nmessage in the inbound ring buffer.\u00a0So let\u2019s assume that happens,\\nthe host puts a message into the ring buffer but does not interrupt.\\n\\nSubsequently, the user space code in the guest sets the inbound ring\\nbuffer interrupt mask to 0, saying \u201cHey, I\u2019m ready for interrupts\u201d.\\nUser space code then calls pread() to wait for an interrupt.\\nThen one of two things happens:\\n\\n* The host never sends another message. So the pread() waits forever.\\n* The host does send another message. But because there\u2019s already a\\n  message in the ring buffer, it doesn\u2019t generate an interrupt.\\n  This is the correct behavior, because the host should only send an\\n  interrupt when the inbound ring buffer transitions from empty to\\n  not-empty. Adding an additional message to a ring buffer that is not\\n  empty is not supposed to generate an interrupt on the guest.\\n  Since the guest is waiting in pread() and not removing messages from\\n  the ring buffer, the pread() waits forever.\\n\\nThis could be easily reproduced in hv_fcopy_uio_daemon if we delay\\nsetting interrupt mask to 0.\\n\\nSimilarly if hv_uio_channel_cb() sets the interrupt_mask to 1,\\nthere\u2019s a race condition. Once user space empties the inbound ring\\nbuffer, but before user space sets interrupt_mask to 0, the host could\\nput another message in the ring buffer but it wouldn\u2019t interrupt.\\nThen the next pread() would hang.\\n\\nFix these by removing all instances where interrupt_mask is changed,\\nwhile keeping the one in set_event() unchanged to enable userspace\\ncontrol the interrupt mask by writing 0/1 to /dev/uioX.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/01ce972e6f9974a7c76943bcb7e93746917db83a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/2af39ab5e6dc46b835a52e80a22d0cad430985e3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/37bd91f22794dc05436130d6983302cb90ecfe7e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/540aac117eaea5723cef5e4cbf3035c4ac654d92\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/65d40acd911c7011745cbbd2aaac34eb5266d11e\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a44f61f878f32071d6378e8dd7c2d47f9490c8f7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/b15b7d2a1b09ef5428a8db260251897405a19496\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/e29587c07537929684faa365027f4b0d87521e1b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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…