{"id":"CVE-2025-40063","aliases":["CVE-2025-40063"],"related":[],"kind":"vulnerability","state":"published","title":"crypto: comp - Use same definition of context alloc and free ops","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: comp - Use same definition of context alloc and free ops\n\nIn commit 42d9f6c77479 (\"crypto: acomp - Move scomp stream allocation\ncode into acomp\"), the crypto_acomp_streams struct was made to rely on\nhaving the alloc_ctx and free_ctx operations defined in the same order\nas the scomp_alg struct. But in that same commit, the alloc_ctx and\nfree_ctx members of scomp_alg may be randomized by structure layout\nrandomization, since they are contained in a pure ops structure\n(containing only function pointers). If the pointers within scomp_alg\nare randomized, but those in crypto_acomp_streams are not, then\nthe order may no longer match. This fixes the problem by removing the\nunion from scomp_alg so that both crypto_acomp_streams and scomp_alg\nwill share the same definition of alloc_ctx and free_ctx, ensuring\nthey will always have the same layout.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: comp - Use same definition of context alloc and free ops\n\nIn commit 42d9f6c77479 (\"crypto: acomp - Move scomp stream allocation\ncode into acomp\"), the crypto_acomp_streams struct was made to rely on\nhaving the alloc_ctx and free_ctx operations defined in the same order\nas the scomp_alg struct. But in that same commit, the alloc_ctx and\nfree_ctx members of scomp_alg may be randomized by structure layout\nrandomization, since they are contained in a pure ops structure\n(containing only function pointers). If the pointers within scomp_alg\nare randomized, but those in crypto_acomp_streams are not, then\nthe order may no longer match. This fixes the problem by removing the\nunion from scomp_alg so that both crypto_acomp_streams and scomp_alg\nwill share the same definition of alloc_ctx and free_ctx, ensuring\nthey will always have the same layout.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncrypto: comp - Usar la misma definición de operaciones de asignación y liberación de contexto\n\nEn el commit 42d9f6c77479 ('crypto: acomp - Mover el código de asignación de flujo scomp a acomp'), se hizo que la estructura crypto_acomp_streams dependiera de tener las operaciones alloc_ctx y free_ctx definidas en el mismo orden que la estructura scomp_alg. Pero en ese mismo commit, los miembros alloc_ctx y free_ctx de scomp_alg pueden ser aleatorizados por la aleatorización del diseño de la estructura, ya que están contenidos en una estructura de operaciones pura (que contiene solo punteros a funciones). Si los punteros dentro de scomp_alg son aleatorizados, pero los de crypto_acomp_streams no lo son, entonces el orden puede dejar de coincidir. Esto soluciona el problema al eliminar la unión de scomp_alg para que tanto crypto_acomp_streams como scomp_alg compartan la misma definición de alloc_ctx y free_ctx, asegurando que siempre tendrán el mismo diseño.","source":"nvd"}],"published":"2025-10-28T11:48:34.549Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"42d9f6c774790d290c175e8775ce9f1366438098","fixed":"779d3b6f2d32c5f1da6163e959abe1e1ffe2945b","status":"affected"},{"type":"git","introduced":"42d9f6c774790d290c175e8775ce9f1366438098","fixed":"f75f66683ded09f7135aef2e763c245a07c8271a","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.16","status":"unaffected"},{"type":"semver","introduced":"6.17.3","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/779d3b6f2d32c5f1da6163e959abe1e1ffe2945b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f75f66683ded09f7135aef2e763c245a07c8271a","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40063","url":"https://www.cve.org/CVERecord?id=CVE-2025-40063","licence":"CVE Terms of Use","modified":"2026-08-05T12:07:28.106Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40063","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40063","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:06.940Z","epss":{"score":0.00133,"percentile":0.03017,"date":"2026-12-01T12:00:22.000Z"}}