CVE-2024-35997 HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up

Medium 5.5 Published Updated

A flaw in the Linux kernel's I2C HID driver can cause a system lock-up via an infinite interrupt loop, requiring a kernel patch to resolve.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-35997?

CVE-2024-35997 is a medium-severity denial of service vulnerability in Linux kernel, published on 20 May 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up

The flag I2C_HID_READ_PENDING is used to serialize I2C operations. However, this is not necessary, because I2C core already has its own locking for that.

More importantly, this flag can cause a lock-up: if the flag is set in i2c_hid_xfer() and an interrupt happens, the interrupt handler (i2c_hid_irq) will check this flag and return immediately without doing anything, then the interrupt handler will be invoked again in an infinite loop.

Since interrupt handler is an RT task, it takes over the CPU and the flag-clearing task never gets scheduled, thus we have a lock-up.

Delete this unnecessary flag.

Weakness: CWE-667

Which versions are affected by CVE-2024-35997?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-35997?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-35997 being exploited?

There is no known exploitation of CVE-2024-35997 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as AZL-42181, AZL-42271, BELL-CVE-2024-35997, DEBIAN-CVE-2024-35997, GHSA-23x8-g5mh-phmc, UBUNTU-CVE-2024-35997.

Is CVE-2024-35997 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free