Skip to content
Heist/ feed
Back to feed
HighFix available

Buffer overflow in drivers/xen/sys-hypervisor.c

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: Buffer overflow in drivers/xen/sys-hypervisor.c The build id returned by HYPERVISOR_xen_version(XENVER_build_id) is neither NUL terminated nor a string. The first causes a buffer overflow as sprintf in buildid_show will read and copy till it finds a NUL. 00000000 f4 91 51 f4 dd 38 9e 9d 65 47 52 eb 10 71 db 50 |..Q..8..eGR..q.P| 00000010 b9 a8 01 42 6f 2e 32 |...Bo.2| 00000017 So use a memcpy instead of sprintf to have the correct value: 00000000 f4 91 51 f4 dd 00 9e 9d 65 47 52 eb 10 71 db 50 |..Q.....eGR..q.P| 00000010 b9 a8 01 42 |...B| 00000014 (the above have a hack to embed a zero inside and check it's returned correctly). This is XSA-485 / CVE-2026-31786

Products
Kernel
Affected versions
Not specified
Fixed versions
5.10.254, 5.15.204, 6.1.170, 6.12.85, 6.18.26, 6.6.137, 7.0.3
CVEs
CVE-2026-31786
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 23:59 UTC · Revision 1

Source evidence

Buffer overflow in drivers/xen/sys-hypervisor.c

core-osv · Original source

Published 30 Apr 2026, 10:31 UTC

In the Linux kernel, the following vulnerability has been resolved: Buffer overflow in drivers/xen/sys-hypervisor.c The build id returned by HYPERVISOR_xen_version(XENVER_build_id) is neither NUL terminated nor a string. The first causes a buffer overflow as sprintf in buildid_show will read and copy till it finds a NUL. 00000000 f4 91 51 f4 dd 38 9e 9d 65 47 52 eb 10 71 db 50 |..Q..8..eGR..q.P| 00000010 b9 a8 01 42 6f 2e 32 |...Bo.2| 00000017 So use a memcpy instead of sprintf to have the correct value: 00000000 f4 91 51 f4 dd 00 9e 9d 65 47 52 eb 10 71 db 50 |..Q.....eGR..q.P| 00000010 b9 a8 01 42 |...B| 00000014 (the above have a hack to embed a zero inside and check it's returned correctly). This is XSA-485 / CVE-2026-31786

osv:CVE-2026-31786

Kernel

Fixed versions: 5.10.254, 5.15.204, 6.1.170, 6.6.137, 6.12.85, 6.18.26, 7.0.3

Complete source record
{
  "id": "a3519b0dd5eba7d6588d9cc229fa6c9314a007fde81d44b886dad0f8086762c0",
  "url": "https://osv.dev/vulnerability/CVE-2026-31786",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Buffer overflow in drivers/xen/sys-hypervisor.c",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: Buffer overflow in drivers/xen/sys-hypervisor.c The build id returned by HYPERVISOR_xen_version(XENVER_build_id) is neither NUL terminated nor a string. The first causes a buffer overflow as sprintf in buildid_show will read and copy till it finds a NUL. 00000000 f4 91 51 f4 dd 38 9e 9d 65 47 52 eb 10 71 db 50 |..Q..8..eGR..q.P| 00000010 b9 a8 01 42 6f 2e 32 |...Bo.2| 00000017 So use a memcpy instead of sprintf to have the correct value: 00000000 f4 91 51 f4 dd 00 9e 9d 65 47 52 eb 10 71 db 50 |..Q.....eGR..q.P| 00000010 b9 a8 01 42 |...B| 00000014 (the above have a hack to embed a zero inside and check it's returned correctly). This is XSA-485 / CVE-2026-31786",
    "evidence": "osv:CVE-2026-31786",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.10.254",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.204",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.170",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.137",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.85",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.18.26",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "7.0.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-31786",
      "aliases": [
        "CVE-2026-31786"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "84b7625728ea311ea35bdaa0eded53c1c56baeaa"
                },
                {
                  "fixed": "e3af585e1728c917682b6a3de9a69b41fb9194d4"
                },
                {
                  "fixed": "8288d031a01dbacfde3fc643f7be3d23504de64d"
                },
                {
                  "fixed": "f458ba102da97fafca106327086fc95f3fc764cb"
                },
                {
                  "fixed": "4b4defd2fce3f966c25adabf46644a85558f1169"
                },
                {
                  "fixed": "5c5ff7c7bd15bb536f44b10b3fb5b8408f344d0a"
                },
                {
                  "fixed": "d5f59216650c51e5e3fcb7517c825bc8047f60ef"
                },
                {
                  "fixed": "52cecff98bda2c51eed1c6ce9d21c5d6268fb19d"
                },
                {
                  "fixed": "27fdbab4221b375de54bf91919798d88520c6e28"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31786.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.13.0"
                },
                {
                  "fixed": "5.10.254"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.204"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.170"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.137"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.85"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.18.26"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.19.0"
                },
                {
                  "fixed": "7.0.3"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-31786.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:40.438422869Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/27fdbab4221b375de54bf91919798d88520c6e28",
        "https://git.kernel.org/stable/c/4b4defd2fce3f966c25adabf46644a85558f1169",
        "https://git.kernel.org/stable/c/52cecff98bda2c51eed1c6ce9d21c5d6268fb19d",
        "https://git.kernel.org/stable/c/5c5ff7c7bd15bb536f44b10b3fb5b8408f344d0a",
        "https://git.kernel.org/stable/c/8288d031a01dbacfde3fc643f7be3d23504de64d",
        "https://git.kernel.org/stable/c/d5f59216650c51e5e3fcb7517c825bc8047f60ef",
        "https://git.kernel.org/stable/c/e3af585e1728c917682b6a3de9a69b41fb9194d4",
        "https://git.kernel.org/stable/c/f458ba102da97fafca106327086fc95f3fc764cb",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31786.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-31786",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31786.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-31786",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 508195,
  "published_at": "2026-04-30T10:31:28.293+00:00"
}