CVE-2025-38585: staging: media: atomisp: Fix stack buffer overflow in gmin_get_var_int()

Published Aug 19, 2025
·
Updated

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

staging: media: atomisp: Fix stack buffer overflow in gmingetvarint()

When gmingetconfigvar() calls efi.getvariable() and the EFI variable is larger than the expected buffer size, two behaviors combine to create a stack buffer overflow:

1. gmingetconfigvar() does not return the proper error code when efi.getvariable() fails. It returns the stale 'ret' value from earlier operations instead of indicating the EFI failure.

2. When efi.getvariable() returns EFIBUFFERTOOSMALL, it updates outlen to the required buffer size but writes no data to the output buffer. However, due to bug #1, gmingetvarint() believes the call succeeded.

The caller gmingetvarint() then performs: - Allocates val[CFGVARNAMEMAX + 1] (65 bytes) on stack - Calls gmingetconfigvar(dev, isgmin, var, val, &len) with len=64 - If EFI variable is >64 bytes, efi.getvariable() sets len=requiredsize - Due to bug #1, thinks call succeeded with len=requiredsize - Executes val[len] = 0, writing past end of 65-byte stack buffer

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 gmingetconfigvar() based on EFI status instead of stale 'ret' value.

The gmingetvarint() function is called during device initialization for camera sensor configuration on Intel Bay Trail and Cherry Trail platforms using the atomisp camera stack.

Affected Software

9 affected components
Linux Linux kernel
Linux Linux kernel>=6.0<6.12.42
Linux Linux kernel>=6.13<6.15.10
Linux Linux kernel>=6.16<6.16.1
Microsoft azl3 kernel 6.6.117.1-1
Microsoft azl3 kernel 6.6.96.2-2
Microsoft azl3 kernel 6.6.96.2-1
Microsoft azl3 kernel 6.6.112.1-2
Microsoft azl3 kernel 6.6.104.2-4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch staging: media: atomisp: Fix stack buffer overflow in gmin_get_var_int()
  2. Configuration

    In gmin_get_config_var(), return the proper error code when efi.get_variable() fails (use the updated EFI status like EFI_BUFFER_TOO_SMALL rather than the stale 'ret' from earlier operations). This prevents gmin_get_var_int() from treating a failed call as success and writing val[len]=0 past the end of the 65-byte buffer when the EFI variable is larger than 64 bytes.

    Linux kernel (atomisp gmin_get_var_int / gmin_get_config_var) return proper error codes from gmin_get_config_var() based on EFI status (e.g., not the stale 'ret' value) = implemented fix

Event History

Aug 19, 2025
CVE Published
via MITRE·05:03 PM
Data Sourced
via MITRE·05:03 PM
Description
Data Sourced
via NVD·05:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 4, 2025
Data Sourced
via Microsoft·03:03 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·03:03 AM
SeverityAffected Software
Updated
via Microsoft·10:03 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What is the severity of CVE-2025-38585?

CVE-2025-38585 has been classified with a severity rating that requires immediate attention due to the potential for stack buffer overflow leading to code execution.

2

How do I fix CVE-2025-38585?

To fix CVE-2025-38585, update to a patched version of the Linux kernel where the vulnerability has been resolved.

3

Which versions of Linux Kernel are affected by CVE-2025-38585?

CVE-2025-38585 affects multiple versions of the Linux kernel prior to the patches which correct the vulnerability.

4

What types of systems are vulnerable to CVE-2025-38585?

Any system running an affected version of the Linux kernel that utilizes the atomisp driver is vulnerable to CVE-2025-38585.

5

What is the potential impact of CVE-2025-38585?

The potential impact of CVE-2025-38585 includes system crashes, data corruption, or unauthorized code execution if exploited.

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