CVE-2025-37850 pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()
A divide-by-zero error in the MediaTek PWM driver can cause a kernel crash when compiled with specific non-default configuration options.
- 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-2025-37850?
CVE-2025-37850 is a medium-severity denial of service vulnerability in Debian Debian Linux, published on 9 May 2025. 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:
pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()
With CONFIG_COMPILE_TEST && !CONFIG_HAVE_CLK, pwm_mediatek_config() has a divide-by-zero in the following line:
do_div(resolution, clk_get_rate(pc->clk_pwms[pwm->hwpwm]));
due to the fact that the !CONFIG_HAVE_CLK version of clk_get_rate() returns zero.
This is presumably just a theoretical problem: COMPILE_TEST overrides the dependency on RALINK which would select COMMON_CLK. Regardless it's a good idea to check for the error explicitly to avoid divide-by-zero.
Fixes the following warning:
drivers/pwm/pwm-mediatek.o: warning: objtool: .text: unexpected end of section
[ukleinek: s/CONFIG_CLK/CONFIG_HAVE_CLK/]
Weakness: CWE-369
Which versions are affected by CVE-2025-37850?
It affects 2 products.
Products include Debian Debian Linux, Linux kernel.
How do I fix CVE-2025-37850?
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-2025-37850 being exploited?
There is no known exploitation of CVE-2025-37850 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as BELL-CVE-2025-37850, DEBIAN-CVE-2025-37850, GHSA-xg2m-hpw9-r98w, ROOT-OS-DEBIAN-12-CVE-2025-37850, ROOT-OS-UBUNTU-2204-CVE-2025-37850, ROOT-OS-UBUNTU-2404-CVE-2025-37850 and 1 more.