CVE-2025-38335: Input: gpio-keys - fix a sleep while atomic with PREEMPT_RT

Published Jul 10, 2025
·
Updated

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

Input: gpio-keys - fix a sleep while atomic with PREEMPTRT

When enabling PREEMPTRT, the gpiokeysirqtimer() callback runs in hard irq context, but the inputevent() takes a spinlock, which isn't allowed there as it is converted to a rtspinlock().

[ 4054.289999] BUG: sleeping function called from invalid context at kernel/locking/spinlockrt.c:48 [ 4054.290028] inatomic(): 1, irqsdisabled(): 1, nonblock: 0, pid: 0, name: swapper/0 ... [ 4054.290195] mightresched+0x13c/0x1f4 [ 4054.290209] rtspinlock+0x54/0x11c [ 4054.290219] inputevent+0x48/0x80 [ 4054.290230] gpiokeysirqtimer+0x4c/0x78 [ 4054.290243] hrtimerrunqueues+0x1a4/0x438 [ 4054.290257] hrtimerinterrupt+0xe4/0x240 [ 4054.290269] archtimerhandlerphys+0x2c/0x44 [ 4054.290283] handlepercpudevidirq+0x8c/0x14c [ 4054.290297] handleirqdesc+0x40/0x58 [ 4054.290307] generichandledomainirq+0x1c/0x28 [ 4054.290316] gichandleirq+0x44/0xcc

Considering the gpiokeysirqisr() can run in any context, e.g. it can be threaded, it seems there's no point in requesting the timer isr to run in hard irq context.

Relax the hrtimer not to use the hard context.

Affected Software

11 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=5.13<5.15.190
Linux Linux kernel>=5.16<6.1.148
Linux Linux kernel>=6.2<6.6.101
Linux Linux kernel>=6.7<6.12.41
Linux Linux kernel>=6.13<6.15.4
Debian Debian Linux=11.0
Microsoft azl3 kernel 6.6.96.2-1
Microsoft cbl2 kernel 5.15.186.1-1
Microsoft azl3 kernel 6.6.96.2-2
debian/linux
6.1.176-16.1.190-16.12.107-16.12.113-17.2.12-17.2.13-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1
  2. Configuration

    Relax the hrtimer so gpio_keys_irq_timer() does not run in hard IRQ context; allow the timer ISR to be threaded.

    Linux kernel Input: gpio-keys gpio_keys_irq_timer() hrtimer execution context = threaded/non-hard context

Event History

Jul 10, 2025
CVE Published
via MITRE·08:15 AM
Data Sourced
via MITRE·08:15 AM
Description
Data Sourced
via NVD·09:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 4, 2025
Data Sourced
via Microsoft·12:19 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-38335?

CVE-2025-38335 has moderate severity due to its impact on systems using the PREEMPT_RT feature in the Linux kernel.

2

How do I fix CVE-2025-38335?

To fix CVE-2025-38335, update your Linux kernel to the latest stable version that addresses this vulnerability.

3

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

CVE-2025-38335 affects Linux kernel versions prior to the fixes included in later updates.

4

What are the implications of CVE-2025-38335 for users?

Users may experience system instability or unexpected behavior when using the gpio_keys_irq_timer() callback with PREEMPT_RT enabled.

5

Where can I find more information about CVE-2025-38335?

Detailed information regarding CVE-2025-38335 is documented in the Linux kernel changelogs and security advisories.

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