{"id":"CVE-2025-38488","aliases":["CVE-2025-38488"],"related":[],"kind":"vulnerability","state":"published","title":"smb: client: fix use-after-free in crypt_message when using async crypto","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix use-after-free in crypt_message when using async crypto\n\nThe CVE-2024-50047 fix removed asynchronous crypto handling from\ncrypt_message(), assuming all crypto operations are synchronous.\nHowever, when hardware crypto accelerators are used, this can cause\nuse-after-free crashes:\n\n  crypt_message()\n    // Allocate the creq buffer containing the req\n    creq = smb2_get_aead_req(..., &req);\n\n    // Async encryption returns -EINPROGRESS immediately\n    rc = enc ? crypto_aead_encrypt(req) : crypto_aead_decrypt(req);\n\n    // Free creq while async operation is still in progress\n    kvfree_sensitive(creq, ...);\n\nHardware crypto modules often implement async AEAD operations for\nperformance. When crypto_aead_encrypt/decrypt() returns -EINPROGRESS,\nthe operation completes asynchronously. Without crypto_wait_req(),\nthe function immediately frees the request buffer, leading to crashes\nwhen the driver later accesses the freed memory.\n\nThis results in a use-after-free condition when the hardware crypto\ndriver later accesses the freed request structure, leading to kernel\ncrashes with NULL pointer dereferences.\n\nThe issue occurs because crypto_alloc_aead() with mask=0 doesn't\nguarantee synchronous operation. Even without CRYPTO_ALG_ASYNC in\nthe mask, async implementations can be selected.\n\nFix by restoring the async crypto handling:\n- DECLARE_CRYPTO_WAIT(wait) for completion tracking\n- aead_request_set_callback() for async completion notification\n- crypto_wait_req() to wait for operation completion\n\nThis ensures the request buffer isn't freed until the crypto operation\ncompletes, whether synchronous or asynchronous, while preserving the\nCVE-2024-50047 fix.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nsmb: client: fix use-after-free in crypt_message when using async crypto\n\nThe CVE-2024-50047 fix removed asynchronous crypto handling from\ncrypt_message(), assuming all crypto operations are synchronous.\nHowever, when hardware crypto accelerators are used, this can cause\nuse-after-free crashes:\n\n  crypt_message()\n    // Allocate the creq buffer containing the req\n    creq = smb2_get_aead_req(..., &req);\n\n    // Async encryption returns -EINPROGRESS immediately\n    rc = enc ? crypto_aead_encrypt(req) : crypto_aead_decrypt(req);\n\n    // Free creq while async operation is still in progress\n    kvfree_sensitive(creq, ...);\n\nHardware crypto modules often implement async AEAD operations for\nperformance. When crypto_aead_encrypt/decrypt() returns -EINPROGRESS,\nthe operation completes asynchronously. Without crypto_wait_req(),\nthe function immediately frees the request buffer, leading to crashes\nwhen the driver later accesses the freed memory.\n\nThis results in a use-after-free condition when the hardware crypto\ndriver later accesses the freed request structure, leading to kernel\ncrashes with NULL pointer dereferences.\n\nThe issue occurs because crypto_alloc_aead() with mask=0 doesn't\nguarantee synchronous operation. Even without CRYPTO_ALG_ASYNC in\nthe mask, async implementations can be selected.\n\nFix by restoring the async crypto handling:\n- DECLARE_CRYPTO_WAIT(wait) for completion tracking\n- aead_request_set_callback() for async completion notification\n- crypto_wait_req() to wait for operation completion\n\nThis ensures the request buffer isn't freed until the crypto operation\ncompletes, whether synchronous or asynchronous, while preserving the\nCVE-2024-50047 fix.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: smb: cliente: corrección del use-after-free en crypt_message al usar criptografía asíncrona. La corrección CVE-2024-50047 eliminó el manejo de criptografía asíncrona de crypt_message(), asumiendo que todas las operaciones de criptografía son síncronas. Sin embargo, cuando se usan aceleradores de criptografía de hardware, esto puede causar fallos de use-after-free: crypt_message() // Asignar el búfer creq que contiene la solicitud creq = smb2_get_aead_req(..., &amp;req); // El cifrado asíncrono devuelve -EINPROGRESS inmediatamente rc = enc ? crypto_aead_encrypt(req) : crypto_aead_decrypt(req); // Liberar creq mientras la operación asíncrona aún está en progreso kvfree_sensitive(creq, ...); Los módulos de criptografía de hardware a menudo implementan operaciones AEAD asíncronas para mejorar el rendimiento. Cuando crypto_aead_encrypt/decrypt() devuelve -EINPROGRESS, la operación se completa de forma asíncrona. Sin crypto_wait_req(), la función libera inmediatamente el búfer de solicitud, lo que provoca fallos cuando el controlador accede posteriormente a la memoria liberada. Esto genera una condición de use-after-free cuando el controlador de cifrado de hardware accede posteriormente a la estructura de solicitud liberada, lo que provoca fallos del kernel con desreferencias de punteros NULL. El problema se produce porque crypto_alloc_aead() con mask=0 no garantiza la operación síncrona. Incluso sin CRYPTO_ALG_ASYNC en la máscara, se pueden seleccionar implementaciones asíncronas. Solución restaurando el manejo de criptografía asíncrona: - DECLARE_CRYPTO_WAIT(wait) para seguimiento de finalización - aead_request_set_callback() para notificación de finalización asíncrona - crypto_wait_req() para esperar a que se complete la operación Esto garantiza que el búfer de solicitud no se libere hasta que se complete la operación de criptografía, ya sea sincrónica o asincrónica, al tiempo que se conserva la corrección CVE-2024-50047.","source":"nvd"}],"published":"2025-07-28T11:21:52.085Z","modified":"2026-08-05T12:02:19.784Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"8f14a476abba13144df5434871a7225fd29af633","fixed":"5d047b12f86cc3b9fde1171c02d9bccf4dba0632","status":"affected"},{"type":"git","introduced":"ef51c0d544b1518b35364480317ab6d3468f205d","fixed":"6550b2bef095d0dd2d2c8390d2ea4c3837028833","status":"affected"},{"type":"git","introduced":"bce966530fd5542bbb422cb45ecb775f7a1a6bc3","fixed":"9a1d3e8d40f151c2d5a5f40c410e6e433f62f438","status":"affected"},{"type":"git","introduced":"0809fb86ad13b29e1d6d491364fc7ea4fb545995","fixed":"15a0a5de49507062bc3be4014a403d8cea5533de","status":"affected"},{"type":"git","introduced":"b0abcd65ec545701b8793e12bc27dc98042b151a","fixed":"2a76bc2b24ed889a689fb1c9015307bf16aafb5b","status":"affected"},{"type":"git","introduced":"b0abcd65ec545701b8793e12bc27dc98042b151a","fixed":"8ac90f6824fc44d2e55a82503ddfc95defb19ae0","status":"affected"},{"type":"git","introduced":"b0abcd65ec545701b8793e12bc27dc98042b151a","fixed":"b220bed63330c0e1733dc06ea8e75d5b9962b6b6","status":"affected"},{"type":"git","version":"538c26d9bf70c90edc460d18c81008a4e555925a","status":"affected"},{"type":"semver","introduced":"5.10.237","fixed":"5.10.241","status":"affected"},{"type":"semver","introduced":"5.15.181","fixed":"5.15.190","status":"affected"},{"type":"semver","introduced":"6.1.128","fixed":"6.1.147","status":"affected"},{"type":"semver","introduced":"6.6.57","fixed":"6.6.100","status":"affected"},{"type":"semver","introduced":"6.11.4","fixed":"6.12","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.12","status":"unaffected"},{"type":"semver","introduced":"5.10.241","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.190","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.147","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.100","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.40","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.8","lastAffected":"6.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.16","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.10.237","fixed":"5.10.241"},{"status":"affected","introduced":"5.15.181","fixed":"5.15.190"},{"status":"affected","introduced":"6.1.128","fixed":"6.1.147"},{"status":"affected","introduced":"6.6.57","fixed":"6.6.100"},{"status":"affected","introduced":"6.11.4","fixed":"6.12.40"},{"status":"affected","introduced":"6.13","fixed":"6.15.8"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/5d047b12f86cc3b9fde1171c02d9bccf4dba0632","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6550b2bef095d0dd2d2c8390d2ea4c3837028833","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9a1d3e8d40f151c2d5a5f40c410e6e433f62f438","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/15a0a5de49507062bc3be4014a403d8cea5533de","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2a76bc2b24ed889a689fb1c9015307bf16aafb5b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8ac90f6824fc44d2e55a82503ddfc95defb19ae0","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b220bed63330c0e1733dc06ea8e75d5b9962b6b6","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38488","url":"https://www.cve.org/CVERecord?id=CVE-2025-38488","licence":"CVE Terms of Use","modified":"2026-08-05T12:02:19.784Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38488","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38488","licence":"Public domain","modified":"2026-07-30T06:23:20.950Z"}],"updatedAt":"2026-11-25T22:59:01.806Z","epss":{"score":0.00786,"percentile":0.573,"date":"2026-12-01T12:00:22.000Z"}}