CVE-2025-38488: smb: client: fix use-after-free in crypt_message when using async crypto

Published Jul 28, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

smb: client: fix use-after-free in cryptmessage when using async crypto

The CVE-2024-50047 fix removed asynchronous crypto handling from cryptmessage(), assuming all crypto operations are synchronous. However, when hardware crypto accelerators are used, this can cause use-after-free crashes:

cryptmessage() // Allocate the creq buffer containing the req creq = smb2getaeadreq(..., &req);

// Async encryption returns -EINPROGRESS immediately rc = enc ? cryptoaeadencrypt(req) : cryptoaeaddecrypt(req);

// Free creq while async operation is still in progress kvfreesensitive(creq, ...);

Hardware crypto modules often implement async AEAD operations for performance. When cryptoaeadencrypt/decrypt() returns -EINPROGRESS, the operation completes asynchronously. Without cryptowaitreq(), the function immediately frees the request buffer, leading to crashes when the driver later accesses the freed memory.

This results in a use-after-free condition when the hardware crypto driver later accesses the freed request structure, leading to kernel crashes with NULL pointer dereferences.

The issue occurs because cryptoallocaead() with mask=0 doesn't guarantee synchronous operation. Even without CRYPTOALGASYNC in the mask, async implementations can be selected.

Fix by restoring the async crypto handling: - DECLARECRYPTOWAIT(wait) for completion tracking - aeadrequestsetcallback() for async completion notification - cryptowaitreq() to wait for operation completion

This ensures the request buffer isn't freed until the crypto operation completes, whether synchronous or asynchronous, while preserving the CVE-2024-50047 fix.

Affected Software

16 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=5.10.237<5.10.241
Linux Linux kernel>=5.15.181<5.15.190
Linux Linux kernel>=6.1.128<6.1.147
Linux Linux kernel>=6.6.57<6.6.100
Linux Linux kernel>=6.11.4<6.12.40
Linux Linux kernel>=6.13<6.15.8
Linux Linux kernel=6.16-rc1
Linux Linux kernel=6.16-rc2
Linux Linux kernel=6.16-rc3
Linux Linux kernel=6.16-rc4
Linux Linux kernel=6.16-rc5
Linux Linux kernel=6.16-rc6
Debian Debian Linux=11.0
Microsoft cbl2 kernel 5.15.186.1-1
Microsoft cbl2 kernel 5.15.186.1-1

Event History

Jul 28, 2025
CVE Published
via MITRE·11:21 AM
Data Sourced
via MITRE·11:21 AM
DescriptionSeverity
Data Sourced
via NVD·12:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 8, 2026
Data Sourced
via Microsoft·01:01 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·09:01 AM
DescriptionSeverity
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-38488?

CVE-2025-38488 has a medium severity rating due to its potential for a use-after-free vulnerability.

2

How do I fix CVE-2025-38488?

To fix CVE-2025-38488, update your Linux kernel to the latest stable version that includes the patch for this vulnerability.

3

Which versions of the Linux kernel are affected by CVE-2025-38488?

CVE-2025-38488 affects multiple versions of the Linux kernel, particularly those prior to the patch addressing the issue.

4

What is the impact of CVE-2025-38488 on system security?

CVE-2025-38488 can potentially allow an attacker to execute arbitrary code or causes a denial of service due to the use-after-free error.

5

Is CVE-2025-38488 related to asynchronous crypto operations?

Yes, CVE-2025-38488 is specifically related to improper handling of async crypto operations in the smb client.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203