In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix use-after-free in crypt_message when using async crypto
The CVE-2024-50047 fix removed asynchronous crypto handling from crypt_message(), 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 ? crypto_aead_encrypt(req) : crypto_aead_decrypt(req);
// Free creq while async operation is still in progress
kvfree_sensitive(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 - cryptowait_req() 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.
[
{
"id": "CVE-2025-38488-03e39e94",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/smb/client/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ac90f6824fc44d2e55a82503ddfc95defb19ae0",
"digest": {
"length": 1971.0,
"function_hash": "130831662726488359710757075537079469104"
},
"deprecated": false
},
{
"id": "CVE-2025-38488-049a9a9f",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/smb/client/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9a1d3e8d40f151c2d5a5f40c410e6e433f62f438",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"135922259349567568966877267031637645834",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"286105981336766284069593179103454393981"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-1621a22b",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/cifs/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d047b12f86cc3b9fde1171c02d9bccf4dba0632",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"128533981054786059274807426409060753358",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"286105981336766284069593179103454393981"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-299d20a0",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/cifs/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6550b2bef095d0dd2d2c8390d2ea4c3837028833",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"128533981054786059274807426409060753358",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"286105981336766284069593179103454393981"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-722fb919",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/smb/client/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b220bed63330c0e1733dc06ea8e75d5b9962b6b6",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"292892910355045750274928427005489455964",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"141951699235098368207641435337109224320"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-7264ab4a",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/smb/client/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9a1d3e8d40f151c2d5a5f40c410e6e433f62f438",
"digest": {
"length": 1894.0,
"function_hash": "137662792475328891056545485501562018277"
},
"deprecated": false
},
{
"id": "CVE-2025-38488-7e072879",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/smb/client/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ac90f6824fc44d2e55a82503ddfc95defb19ae0",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"292892910355045750274928427005489455964",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"141951699235098368207641435337109224320"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-bdb9316f",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/smb/client/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@15a0a5de49507062bc3be4014a403d8cea5533de",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"292892910355045750274928427005489455964",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"141951699235098368207641435337109224320"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-cbb87554",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/cifs/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5d047b12f86cc3b9fde1171c02d9bccf4dba0632",
"digest": {
"length": 1881.0,
"function_hash": "218154887192844899519822327873292921981"
},
"deprecated": false
},
{
"id": "CVE-2025-38488-d3fd528f",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/smb/client/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b220bed63330c0e1733dc06ea8e75d5b9962b6b6",
"digest": {
"length": 1971.0,
"function_hash": "130831662726488359710757075537079469104"
},
"deprecated": false
},
{
"id": "CVE-2025-38488-de6530ce",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/smb/client/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2a76bc2b24ed889a689fb1c9015307bf16aafb5b",
"digest": {
"length": 1971.0,
"function_hash": "130831662726488359710757075537079469104"
},
"deprecated": false
},
{
"id": "CVE-2025-38488-e102788c",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/cifs/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6550b2bef095d0dd2d2c8390d2ea4c3837028833",
"digest": {
"length": 1881.0,
"function_hash": "218154887192844899519822327873292921981"
},
"deprecated": false
},
{
"id": "CVE-2025-38488-ef64f317",
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "fs/smb/client/smb2ops.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2a76bc2b24ed889a689fb1c9015307bf16aafb5b",
"digest": {
"line_hashes": [
"209323897754334637849845775396249968614",
"107620911153536622770149730339223444635",
"301952836345209367960076696478437493557",
"292892910355045750274928427005489455964",
"144027039256190253741663374402783361528",
"323439993400722381879552385387777612212",
"169787874320999492825258970947427963801",
"141951699235098368207641435337109224320"
],
"threshold": 0.9
},
"deprecated": false
},
{
"id": "CVE-2025-38488-fd1c60b4",
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "fs/smb/client/smb2ops.c",
"function": "crypt_message"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@15a0a5de49507062bc3be4014a403d8cea5533de",
"digest": {
"length": 1971.0,
"function_hash": "130831662726488359710757075537079469104"
},
"deprecated": false
}
]