CVE-2025-38585
In the Linux kernel, the following vulnerability has been resolved:
staging: media: atomisp: Fix stack buffer overflow in gmin_get_var_int()
When gmin_get_config_var() calls efi.get_variable() and the EFI variable is larger than the expected buffer size, two behaviors combine to create a stack buffer overflow:
The caller gmin_get_var_int() then performs: - Allocates val[CFG_VAR_NAME_MAX + 1] (65 bytes) on stack - Calls gmin_get_config_var(dev, is_gmin, var, val, &len) with len=64 - If EFI variable is >64 bytes, efi.get_variable() sets len=required_size - Due to bug #1, thinks call succeeded with len=required_size - Executes val[len] = 0, writing past end of 65-byte stack buffer
Leer descripción completaMostrar menos
This creates a stack buffer overflow when EFI variables are larger than 64 bytes. Since EFI variables can be controlled by firmware or system configuration, this could potentially be exploited for code execution.
Fix the bug by returning proper error codes from gmin_get_config_var() based on EFI status instead of stale 'ret' value.
The gmin_get_var_int() function is called during device initialization for camera sensor configuration on Intel Bay Trail and Cherry Trail platforms using the atomisp camera stack.
Detalles técnicos trazas, registros y código del informe original
1. gmin_get_config_var() does not return the proper error code when efi.get_variable() fails. It returns the stale 'ret' value from earlier operations instead of indicating the EFI failure. 2. When efi.get_variable() returns EFI_BUFFER_TOO_SMALL, it updates *out_len to the required buffer size but writes no data to the output buffer. However, due to bug #1, gmin_get_var_int() believes the call succeeded.
CVSS
- Versión: 3.1
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Puntuación base: 7.8
Probabilidad de explotación (EPSS)
- Probabilidad de explotación en los próximos 30 días: 0.21%
- Percentil entre todas las CVEs puntuadas: 10
- Fecha de la puntuación: 6/10/2026
EPSS (Exploit Prediction Scoring System, de FIRST) estima la probabilidad de que una vulnerabilidad sea explotada en 30 días. Complementa a CVSS (impacto) y a CISA KEV (explotación confirmada).
🎯 Técnicas ATT&CK
Cómo se explota esta vulnerabilidad y qué consigue el atacante, en el lenguaje de MITRE ATT&CK.
- Explotación
T1068Exploitation for Privilege Escalationprivilege escalation85 % - Impacto principal
T1059Command and Scripting Interpreterexecution80 %
Buffer de pila vulnerable (CWE-787) con acceso local (AV:L) y privilegios de usuario (PR:L) permite escalada de privilegios y ejecución de código en kernel.
Inferido por nuestro agente de análisis a partir de la descripción oficial, el vector CVSS y la CWE, y comprobado por un supervisor. Puede contener errores.
🛡️ Mitigaciones ATT&CK que cubren estas técnicas
Tecnologías afectadas (1)
CWE
- CWE-787
Referencias
- https://git.kernel.org/stable/c/1a7a2f59fb2eb0718a0cff1e5822500cefe50ed9
- https://git.kernel.org/stable/c/3d672fe065aa00f4d66f42e3c9720f69a3ed43e7
- https://git.kernel.org/stable/c/51b8dc5163d2ff2bf04019f8bf7e3bd0e75bb654
- https://git.kernel.org/stable/c/e6d3453a002e89537e6136f6c774659b297a549b
- https://git.kernel.org/stable/c/ee4cf798202d285dcbe85e4467a094c44f5ed8e6
JSON original (NVD)
Mostrar
{
"id": "CVE-2025-38585",
"cveTags": [],
"metrics": {
"cvssMetricV31": [
{
"type": "Primary",
"source": "nvd@nist.gov",
"cvssData": {
"scope": "UNCHANGED",
"version": "3.1",
"baseScore": 7.8,
"attackVector": "LOCAL",
"baseSeverity": "HIGH",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"integrityImpact": "HIGH",
"userInteraction": "NONE",
"attackComplexity": "LOW",
"availabilityImpact": "HIGH",
"privilegesRequired": "LOW",
"confidentialityImpact": "HIGH"
},
"impactScore": 5.9,
"exploitabilityScore": 1.8
}
]
},
"affected": [
{
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
"affectedData": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "a49d25364dfb9f8a64037488a39ab1f56c5fa419",
"lessThan": "51b8dc5163d2ff2bf04019f8bf7e3bd0e75bb654",
"versionType": "git"
},
{
"status": "affected",
"version": "ad85094b293e40e7a2f831b0311a389d952ebd5e",
"lessThan": "3d672fe065aa00f4d66f42e3c9720f69a3ed43e7",
"versionType": "git"
},
{
"status": "affected",
"version": "ad85094b293e40e7a2f831b0311a389d952ebd5e",
"lessThan": "e6d3453a002e89537e6136f6c774659b297a549b",
"versionType": "git"
},
{
"status": "affected",
"version": "ad85094b293e40e7a2f831b0311a389d952ebd5e",
"lessThan": "1a7a2f59fb2eb0718a0cff1e5822500cefe50ed9",
"versionType": "git"
},
{
"status": "affected",
"version": "ad85094b293e40e7a2f831b0311a389d952ebd5e",
"lessThan": "ee4cf798202d285dcbe85e4467a094c44f5ed8e6",
"versionType": "git"
}
],
"programFiles": [
"drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "4.12"
},
{
"status": "affected",
"version": "5.8"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "4.12",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "4.18",
"lessThan": "5.8",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "6.12.42",
"versionType": "semver",
"lessThanOrEqual": "6.12.*"
},
{
"status": "unaffected",
"version": "6.15.10",
"versionType": "semver",
"lessThanOrEqual": "6.15.*"
},
{
"status": "unaffected",
"version": "6.16.1",
"versionType": "semver",
"lessThanOrEqual": "6.16.*"
},
{
"status": "unaffected",
"version": "6.17",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c"
],
"defaultStatus": "affected"
}
]
}
],
"published": "2025-08-19T17:15:35.877",
"references": [
{
"url": "https://git.kernel.org/stable/c/1a7a2f59fb2eb0718a0cff1e5822500cefe50ed9",
"tags": [
"Patch"
],
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/3d672fe065aa00f4d66f42e3c9720f69a3ed43e7",
"tags": [
"Patch"
],
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/51b8dc5163d2ff2bf04019f8bf7e3bd0e75bb654",
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/e6d3453a002e89537e6136f6c774659b297a549b",
"tags": [
"Patch"
],
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
},
{
"url": "https://git.kernel.org/stable/c/ee4cf798202d285dcbe85e4467a094c44f5ed8e6",
"tags": [
"Patch"
],
"source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}
],
"vulnStatus": "Modified",
"weaknesses": [
{
"type": "Primary",
"source": "nvd@nist.gov",
"description": [
{
"lang": "en",
"value": "CWE-787"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "In the Linux kernel, the following vulnerability has been resolved:\n\nstaging: media: atomisp: Fix stack buffer overflow in gmin_get_var_int()\n\nWhen gmin_get_config_var() calls efi.get_variable() and the EFI variable\nis larger than the expected buffer size, two behaviors combine to create\na stack buffer overflow:\n\n1. gmin_get_config_var() does not return the proper error code when\n efi.get_variable() fails. It returns the stale 'ret' value from\n earlier operations instead of indicating the EFI failure.\n\n2. When efi.get_variable() returns EFI_BUFFER_TOO_SMALL, it updates\n *out_len to the required buffer size but writes no data to the output\n buffer. However, due to bug #1, gmin_get_var_int() believes the call\n succeeded.\n\nThe caller gmin_get_var_int() then performs:\n- Allocates val[CFG_VAR_NAME_MAX + 1] (65 bytes) on stack\n- Calls gmin_get_config_var(dev, is_gmin, var, val, &len) with len=64\n- If EFI variable is >64 bytes, efi.get_variable() sets len=required_size\n- Due to bug #1, thinks call succeeded with len=required_size\n- Executes val[len] = 0, writing past end of 65-byte stack buffer\n\nThis creates a stack buffer overflow when EFI variables are larger than\n64 bytes. Since EFI variables can be controlled by firmware or system\nconfiguration, this could potentially be exploited for code execution.\n\nFix the bug by returning proper error codes from gmin_get_config_var()\nbased on EFI status instead of stale 'ret' value.\n\nThe gmin_get_var_int() function is called during device initialization\nfor camera sensor configuration on Intel Bay Trail and Cherry Trail\nplatforms using the atomisp camera stack."
},
{
"lang": "es",
"value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: staging: media: atomisp: Corrección del desbordamiento del búfer de pila en gmin_get_var_int() Cuando gmin_get_config_var() llama a efi.get_variable() y la variable EFI es mayor que el tamaño de búfer esperado, se combinan dos comportamientos para crear un desbordamiento del búfer de pila: 1. gmin_get_config_var() no devuelve el código de error correcto cuando efi.get_variable() falla. Devuelve el valor 'ret' obsoleto de operaciones anteriores en lugar de indicar el fallo de EFI. 2. Cuando efi.get_variable() devuelve EFI_BUFFER_TOO_SMALL, actualiza *out_len al tamaño de búfer requerido, pero no escribe datos en el búfer de salida. Sin embargo, debido al error n.º 1, gmin_get_var_int() cree que la llamada tuvo éxito. El llamador gmin_get_var_int() realiza entonces: - Asigna val[CFG_VAR_NAME_MAX + 1] (65 bytes) en la pila - Llama a gmin_get_config_var(dev, is_gmin, var, val, &len) con len=64 - Si la variable EFI es >64 bytes, efi.get_variable() establece len=required_size - Debido al error #1, piensa que la llamada tuvo éxito con len=required_size - Ejecuta val[len] = 0, escribiendo más allá del final del búfer de pila de 65 bytes Esto crea un desbordamiento del búfer de pila cuando las variables EFI son mayores de 64 bytes. Dado que las variables EFI pueden ser controladas por el firmware o la configuración del sistema, esto podría ser potencialmente explotado para la ejecución de código. Corrija el error devolviendo los códigos de error adecuados de gmin_get_config_var() basados en el estado de EFI en lugar del valor 'ret' obsoleto. La función gmin_get_var_int() se llama durante la inicialización del dispositivo para la configuración del sensor de la cámara en las plataformas Intel Bay Trail y Cherry Trail utilizando la pila de cámara atomisp."
}
],
"lastModified": "2026-06-17T09:17:09.880",
"configurations": [
{
"nodes": [
{
"negate": false,
"cpeMatch": [
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"vulnerable": true,
"matchCriteriaId": "7834437B-ADB5-40E8-B1E0-F57F1A9F41A9",
"versionEndExcluding": "6.12.42",
"versionStartIncluding": "6.0"
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"vulnerable": true,
"matchCriteriaId": "5890C690-B295-40C2-9121-FF5F987E5142",
"versionEndExcluding": "6.15.10",
"versionStartIncluding": "6.13"
},
{
"criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
"vulnerable": true,
"matchCriteriaId": "58182352-D7DF-4CC9-841E-03C1D852C3FB",
"versionEndExcluding": "6.16.1",
"versionStartIncluding": "6.16"
}
],
"operator": "OR"
}
]
}
],
"sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
}