CVE-2021-46940 tools/power turbostat: Fix offset overflow issue in index converting

Medium 5.5 Published Updated

An integer overflow in the Linux kernel turbostat tool prevents background stat updates, causing a denial of service for power monitoring.

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-2021-46940?

CVE-2021-46940 is a medium-severity vulnerability in Linux kernel, published on 27 Feb 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:

tools/power turbostat: Fix offset overflow issue in index converting

The idx_to_offset() function returns type int (32-bit signed), but MSR_PKG_ENERGY_STAT is u32 and would be interpreted as a negative number. The end result is that it hits the if (offset < 0) check in update_msr_sum() which prevents the timer callback from updating the stat in the background when long durations are used. The similar issue exists in offset_to_idx() and update_msr_sum(). Fix this issue by converting the 'int' to 'off_t' accordingly.

Weakness: CWE-190

Which versions are affected by CVE-2021-46940?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2021-46940?

Apply the vendor's patch.

Is CVE-2021-46940 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as DEBIAN-CVE-2021-46940, GHSA-3whp-4394-49gc, UBUNTU-CVE-2021-46940.

Is CVE-2021-46940 in your software?

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

Check your SBOMs for free