# CVE-2025-37850: pwm: mediatek: Prevent divide-by-zero in pwm\_mediatek\_config()

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-05-09 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2025-37850, DEBIAN-CVE-2025-37850
- Record: https://cvemate.com/vulnerability/CVE-2025-37850 · JSON: https://cvemate.com/vulnerability/CVE-2025-37850/json

## Description

```text
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/]
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.304%, percentile 24.986%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 142)

- debian linux (Debian): \< 6.1.135-1 \| \< 6.12.25-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-144.157 \| \< 6.8.0-100.100
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1088.95 \| \< 6.8.0-1046.49
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1088.95~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1046.49~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1088.95+fips1 \| \< 6.8.0-1046.49+fips1
- ubuntu linux-aws-hwe (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1094.103 \| \< 6.8.0-1046.52
- ubuntu linux-azure-4.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 44)

- <https://git.kernel.org/stable/c/8b9f60725d74b72c238e4437c957d0217746b506>
- <https://git.kernel.org/stable/c/e1206d8e1651c9f62e5640b69b14d925b1a0a00a>
- <https://git.kernel.org/stable/c/e3cf0c38d3ce754ad63005102fcfeb0b7ff3290b>
- <https://git.kernel.org/stable/c/f3e9cf266c2c103cf071e15d7a17e2c699fff3c5>
- <https://git.kernel.org/stable/c/8ddbec73ea2598d8414e8f7103241b55cf877010>
- <https://git.kernel.org/stable/c/4cb15042b5f3ec0474e91cf379120cc597625dbb>
- <https://git.kernel.org/stable/c/c343856ff2689ce0afef823592732fc178ef4aac>
- <https://git.kernel.org/stable/c/77fb96dbe350e8a5ae4965ff9f6e7049f3966a6b>
- <https://git.kernel.org/stable/c/7ca59947b5fcf94e7ea4029d1bd0f7c41500a161>
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>
- <https://ubuntu.com/security/CVE-2025-37850>
- <https://www.cve.org/CVERecord?id=CVE-2025-37850>
- <https://git.kernel.org/linus/7ca59947b5fcf94e7ea4029d1bd0f7c41500a161>
- <https://ubuntu.com/security/notices/USN-7594-1>
- <https://ubuntu.com/security/notices/USN-7594-2>
- <https://ubuntu.com/security/notices/USN-7594-3>
- <https://ubuntu.com/security/notices/USN-7654-1>
- <https://ubuntu.com/security/notices/USN-7654-2>
- <https://ubuntu.com/security/notices/USN-7654-3>

---

Data as of 2026-12-05T06:22:30.184Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
