{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2025-40182", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2025-04-16T07:20:57.177Z", "datePublished": "2025-11-12T21:56:26.699Z", "dateUpdated": "2026-08-05T12:08:22.418Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T12:08:22.418Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: skcipher - Fix reqsize handling\n\nCommit afddce13ce81d (\"crypto: api - Add reqsize to crypto_alg\")\nintroduced cra_reqsize field in crypto_alg struct to replace type\nspecific reqsize fields. It looks like this was introduced specifically\nfor ahash and acomp from the commit description as subsequent commits\nadd necessary changes in these alg frameworks.\n\nHowever, this is being recommended for use in all crypto algs [1]\ninstead of setting reqsize using crypto_*_set_reqsize(). Using\ncra_reqsize in skcipher algorithms, hence, causes memory\ncorruptions and crashes as the underlying functions in the algorithm\nframework have not been updated to set the reqsize properly from\ncra_reqsize. [2]\n\nAdd proper set_reqsize calls in the skcipher init function to\nproperly initialize reqsize for these algorithms in the framework.\n\n[1]: https://lore.kernel.org/linux-crypto/aCL8BxpHr5OpT04k@gondor.apana.org.au/\n[2]: https://gist.github.com/Pratham-T/24247446f1faf4b7843e4014d5089f6b" } ], "metrics": [ { "cvssV3_1": { "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" }, "scenarios": [ { "lang": "en", "value": "AV:L - The vulnerable skcipher request path is entered through local interfaces — an `AF_ALG` socket bound to `ecb(aes)`/`cbc(aes)`, or ordinary file I/O on a dm-crypt/fscrypt volume on an affected SoC. It is not itself a network-facing subsystem, and the async-only driver is excluded from the sync/on-stack consumers such as Bluetooth SMP.\nAC:L - With `reqsize == 0` the out-of-bounds write happens deterministically on the very first encrypt/decrypt request; there is no race and no condition outside the attacker's control. The attacker fully controls allocation size, timing and repetition, making `kmalloc-96` heap grooming of the adjacent victim object reliable.\nPR:L - Opening an `AF_ALG` socket and selecting the algorithm (by name or by `cra_driver_name`) requires no capability whatsoever — any unprivileged local user suffices, as does simply reading/writing a dm-crypt or fscrypt-encrypted file.\nUI:N - The attacker triggers the corrupting crypto operation entirely on their own via a socket write or file I/O; no victim action or cooperation is needed.\nS:U - The out-of-bounds write corrupts kernel slab memory within the same kernel security authority; there is no VM, IOMMU, or sandbox boundary crossed.\nC:H - A controlled ~40-byte heap out-of-bounds write into an adjacent `kmalloc-96` object, plus type confusion onto dm-crypt's `dm_crypt_request` pointer fields (`ctx`, `sg_in`, `sg_out`), is readily leveraged into an arbitrary kernel-memory read primitive and disclosure of adjacent object contents.\nI:H - This is a straight out-of-bounds heap write with partially attacker-controlled content, and the clobbered region contains a `struct completion` whose `list_head` is linked and unlinked by `wait_for_completion_timeout()`/`complete()`, yielding pointer writes usable for control-flow hijacking or privilege escalation.\nA:H - The commit explicitly states the defect \"causes memory corruptions and crashes,\" and the referenced reproducer demonstrates kernel oopses; slab corruption plus a bogus spinlock/list in freed-adjacent memory reliably panics the system." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "crypto/skcipher.c" ], "versions": [ { "version": "afddce13ce81d52a13898fa0700917835c71acd6", "lessThan": "f041339d6b9a5a46437f0c48fc7279c92af7a513", "status": "affected", "versionType": "git" }, { "version": "afddce13ce81d52a13898fa0700917835c71acd6", "lessThan": "229c586b5e86979badb7cb0d38717b88a9e95ddd", "status": "affected", "versionType": "git" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "crypto/skcipher.c" ], "versions": [ { "version": "6.16", "status": "affected" }, { "version": "0", "lessThan": "6.16", "status": "unaffected", "versionType": "semver" }, { "version": "6.17.4", "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": "6.16", "versionEndExcluding": "6.17.4" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.16", "versionEndExcluding": "6.18" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/f041339d6b9a5a46437f0c48fc7279c92af7a513" }, { "url": "https://git.kernel.org/stable/c/229c586b5e86979badb7cb0d38717b88a9e95ddd" } ], "title": "crypto: skcipher - Fix reqsize handling", "x_generator": { "engine": "bippy-1.2.0" } } } }