{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-40084",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T07:20:57.161Z",
        "datePublished": "2025-10-29T13:37:03.185Z",
        "dateUpdated": "2026-08-05T12:07:38.947Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:07:38.947Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: transport_ipc: validate payload size before reading handle\n\nhandle_response() dereferences the payload as a 4-byte handle without\nverifying that the declared payload size is at least 4 bytes. A malformed\nor truncated message from ksmbd.mountd can lead to a 4-byte read past the\ndeclared payload size. Validate the size before dereferencing.\n\nThis is a minimal fix to guard the initial handle read."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "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"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The vulnerable code is reached only via a generic netlink message to the `SMBD_GENL` family (`handle_generic_event` → `handle_response`), which requires a local socket on the machine; a remote SMB client on TCP/445 cannot inject IPC responses.\nAC:L - The attacker fully controls the crafted netlink message — a zero-length `KSMBD_EVENT_RPC_RESPONSE`/`SPNEGO_AUTHEN_RESPONSE` attribute followed by a chosen nlattr header supplies both the undersized `sz` and the out-of-bounds \"handle\" value, and IDA-allocated handles are small and brute-forceable.\nPR:L - The `netlink_capable(CAP_NET_ADMIN)` gate exists only when `CONFIG_SMB_SERVER_CHECK_CAP_NET_ADMIN` is set, and builds that disable it let any unprivileged local user open a `NETLINK_GENERIC` socket and send the message; there is also no check binding the sender to the registered `ksmbd_tools_pid`.\nUI:N - The attacker sends the malformed netlink message directly; no victim action is needed beyond ksmbd already running, which is the normal state on an SMB server.\nS:U - The out-of-bounds read and the resulting fault stay within the kernel's own security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The unchecked deref reads 4 bytes past the declared payload, and the undersized response it admits causes `ipc_validate_msg()` and the SPNEGO/RPC consumers to read fields beyond a tiny slab allocation, whose contents can be reflected back toward the SMB client.\nI:N - The `memcpy(entry->response, payload, sz)` is bounded by the same `sz` used for the allocation, so the bug yields no out-of-bounds write or other data-modification primitive.\nA:H - A zero-length payload makes `kvzalloc(0)` return `ZERO_SIZE_PTR`, which passes the non-NULL check and is then dereferenced in `ipc_validate_msg()`, producing a kernel oops that is repeatable at will."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/smb/server/transport_ipc.c"
                    ],
                    "versions": [
                        {
                            "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
                            "lessThan": "a02e432d5130da4c723aabe1205bac805889fdb2",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
                            "lessThan": "2dc125f5da134c0915a840b62565c60a595673dd",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
                            "lessThan": "898d527ed94c19980a4d848f10057f1fed578ffb",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
                            "lessThan": "867ffd9d67285612da3f0498ca618297f8e41f01",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "0626e6641f6b467447c81dd7678a69c66f7746cf",
                            "lessThan": "6f40e50ceb99fc8ef37e5c56e2ec1d162733fef0",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/smb/server/transport_ipc.c"
                    ],
                    "versions": [
                        {
                            "version": "5.15",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.15",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.158",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.115",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.56",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.17.6",
                            "lessThanOrEqual": "6.17.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.15",
                                    "versionEndExcluding": "6.1.158"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.15",
                                    "versionEndExcluding": "6.6.115"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.15",
                                    "versionEndExcluding": "6.12.56"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.15",
                                    "versionEndExcluding": "6.17.6"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.15",
                                    "versionEndExcluding": "6.18"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/a02e432d5130da4c723aabe1205bac805889fdb2"
                },
                {
                    "url": "https://git.kernel.org/stable/c/2dc125f5da134c0915a840b62565c60a595673dd"
                },
                {
                    "url": "https://git.kernel.org/stable/c/898d527ed94c19980a4d848f10057f1fed578ffb"
                },
                {
                    "url": "https://git.kernel.org/stable/c/867ffd9d67285612da3f0498ca618297f8e41f01"
                },
                {
                    "url": "https://git.kernel.org/stable/c/6f40e50ceb99fc8ef37e5c56e2ec1d162733fef0"
                }
            ],
            "title": "ksmbd: transport_ipc: validate payload size before reading handle",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}