# CVE-2022-49945: hwmon: (gpio-fan) Fix array out of bounds access

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-06-18T11:00:01.037Z
- **Modified:** 2026-06-17T05:19:35.510Z

## Who should check

- Anyone running Linux \>= b5cf88e46badea6d600d8515edea23814e03444d, \< e9f6972ab40a82bd7f6d36800792ba2e084474d8; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 3ff866455e1e263a9ac1958095fd440984248e2f; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< c8ae6a18708f260ccdeef6ba53af7548457dc26c; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 7756eb1ed124753f4d64f761fc3d84290dffcb4d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 517dba798793e69b510779c3cde7224a65f3ed1d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 53196e0376205ed49b75bfd0475af5e0fbd20156; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 3263984c7acdcb0658155b05a724ed45a10de76d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< f233d2be38dbbb22299192292983037f01ab363c
- Anyone running Linux 4.1

## Description

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

hwmon: (gpio-fan) Fix array out of bounds access

The driver does not check if the cooling state passed to
gpio\_fan\_set\_cur\_state() exceeds the maximum cooling state as
stored in fan\_data-\>num\_speeds. Since the cooling state is later
used as an array index in set\_fan\_speed(), an array out of bounds
access can occur.
This can be exploited by setting the state of the thermal cooling device
to arbitrary values, causing for example a kernel oops when unavailable
memory is accessed this way.

Example kernel oops:
\[  807.987276\] Unable to handle kernel paging request at virtual address ffffff80d0588064
\[  807.987369\] Mem abort info:
\[  807.987398\]   ESR = 0x96000005
\[  807.987428\]   EC = 0x25: DABT (current EL), IL = 32 bits
\[  807.987477\]   SET = 0, FnV = 0
\[  807.987507\]   EA = 0, S1PTW = 0
\[  807.987536\]   FSC = 0x05: level 1 translation fault
\[  807.987570\] Data abort info:
\[  807.987763\]   ISV = 0, ISS = 0x00000005
\[  807.987801\]   CM = 0, WnR = 0
\[  807.987832\] swapper pgtable: 4k pages, 39-bit VAs, pgdp=0000000001165000
\[  807.987872\] \[ffffff80d0588064\] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
\[  807.987961\] Internal error: Oops: 96000005 \[\#1\] PREEMPT SMP
\[  807.987992\] Modules linked in: cmac algif\_hash aes\_arm64 algif\_skcipher af\_alg bnep hci\_uart btbcm bluetooth ecdh\_generic ecc 8021q garp stp llc snd\_soc\_hdmi\_codec brcmfmac vc4 brcmutil cec drm\_kms\_helper snd\_soc\_core cfg80211 snd\_compress bcm2835\_codec(C) snd\_pcm\_dmaengine syscopyarea bcm2835\_isp(C) bcm2835\_v4l2(C) sysfillrect v4l2\_mem2mem bcm2835\_mmal\_vchiq(C) raspberrypi\_hwmon sysimgblt videobuf2\_dma\_contig videobuf2\_vmalloc fb\_sys\_fops videobuf2\_memops rfkill videobuf2\_v4l2 videobuf2\_common i2c\_bcm2835 snd\_bcm2835(C) videodev snd\_pcm snd\_timer snd mc vc\_sm\_cma(C) gpio\_fan uio\_pdrv\_genirq uio drm fuse drm\_panel\_orientation\_quirks backlight ip\_tables x\_tables ipv6
\[  807.988508\] CPU: 0 PID: 1321 Comm: bash Tainted: G         C        5.15.56-v8+ \#1575
\[  807.988548\] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
\[  807.988574\] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
\[  807.988608\] pc : set\_fan\_speed.part.5+0x34/0x80 \[gpio\_fan\]
\[  807.988654\] lr : gpio\_fan\_set\_cur\_state+0x34/0x50 \[gpio\_fan\]
\[  807.988691\] sp : ffffffc008cf3bd0
\[  807.988710\] x29: ffffffc008cf3bd0 x28: ffffff80019edac0 x27: 0000000000000000
\[  807.988762\] x26: 0000000000000000 x25: 0000000000000000 x24: ffffff800747c920
\[  807.988787\] x23: 000000000000000a x22: ffffff800369f000 x21: 000000001999997c
\[  807.988854\] x20: ffffff800369f2e8 x19: ffffff8002ae8080 x18: 0000000000000000
\[  807.988877\] x17: 0000000000000000 x16: 0000000000000000 x15: 000000559e271b70
\[  807.988938\] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
\[  807.988960\] x11: 0000000000000000 x10: ffffffc008cf3c20 x9 : ffffffcfb60c741c
\[  807.989018\] x8 : 000000000000000a x7 : 00000000ffffffc9 x6 : 0000000000000009
\[  807.989040\] x5 : 000000000000002a x4 : 0000000000000000 x3 : ffffff800369f2e8
\[  807.989062\] x2 : 000000000000e780 x1 : 0000000000000001 x0 : ffffff80d0588060
\[  807.989084\] Call trace:
\[  807.989091\]  set\_fan\_speed.part.5+0x34/0x80 \[gpio\_fan\]
\[  807.989113\]  gpio\_fan\_set\_cur\_state+0x34/0x50 \[gpio\_fan\]
\[  807.989199\]  cur\_state\_store+0x84/0xd0
\[  807.989221\]  dev\_attr\_store+0x20/0x38
\[  807.989262\]  sysfs\_kf\_write+0x4c/0x60
\[  807.989282\]  kernfs\_fop\_write\_iter+0x130/0x1c0
\[  807.989298\]  new\_sync\_write+0x10c/0x190
\[  807.989315\]  vfs\_write+0x254/0x378
\[  807.989362\]  ksys\_write+0x70/0xf8
\[  807.989379\]  \_\_arm64\_sys\_write+0x24/0x30
\[  807.989424\]  invoke\_syscall+0x4c/0x110
\[  807.989442\]  el0\_svc\_common.constprop.3+0xfc/0x120
\[  807.989458\]  do\_el0\_svc+0x2c/0x90
\[  807.989473\]  el0\_svc+0x24/0x60
\[  807.989544\]  el0t\_64\_sync\_handler+0x90/0xb8
\[  807.989558\]  el0t\_64\_sync+0x1a0/0x1a4
\[  807.989579\] Code: b9403801 f9402800 7100003f 8b35cc00 (b9400416)
\[  807.989627\] ---\[ end t
---truncated---

## Affected and fixed versions

- Linux: \>= b5cf88e46badea6d600d8515edea23814e03444d, \< e9f6972ab40a82bd7f6d36800792ba2e084474d8; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 3ff866455e1e263a9ac1958095fd440984248e2f; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< c8ae6a18708f260ccdeef6ba53af7548457dc26c; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 7756eb1ed124753f4d64f761fc3d84290dffcb4d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 517dba798793e69b510779c3cde7224a65f3ed1d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 53196e0376205ed49b75bfd0475af5e0fbd20156; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 3263984c7acdcb0658155b05a724ed45a10de76d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< f233d2be38dbbb22299192292983037f01ab363c (cvelist)
- Linux: 4.1 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49945. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49945.md
Affected: Linux >= b5cf88e46badea6d600d8515edea23814e03444d, < e9f6972ab40a82bd7f6d36800792ba2e084474d8; >= b5cf88e46badea6d600d8515edea23814e03444d, < 3ff866455e1e263a9ac1958095fd440984248e2f; >= b5cf88e46badea6d600d8515edea23814e03444d, < c8ae6a18708f260ccdeef6ba53af7548457dc26c; >= b5cf88e46badea6d600d851…
Fixed in: Linux 3ff866455e1e263a9ac1958095fd440984248e2f, Linux 7756eb1ed124753f4d64f761fc3d84290dffcb4d, Linux 517dba798793e69b510779c3cde7224a65f3ed1d, Linux 53196e0376205ed49b75bfd0475af5e0fbd20156, Linux 3263984c7acdcb0658155b05a724ed45a10de76d

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49945 being exploited?

There is no confirmed exploitation: CVE-2022-49945 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.29% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49945?

High: CVSS 7.1 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49945?

Linux \>= b5cf88e46badea6d600d8515edea23814e03444d, \< e9f6972ab40a82bd7f6d36800792ba2e084474d8; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 3ff866455e1e263a9ac1958095fd440984248e2f; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< c8ae6a18708f260ccdeef6ba53af7548457dc26c; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 7756eb1ed124753f4d64f761fc3d84290dffcb4d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 517dba798793e69b510779c3cde7224a65f3ed1d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 53196e0376205ed49b75bfd0475af5e0fbd20156; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< 3263984c7acdcb0658155b05a724ed45a10de76d; \>= b5cf88e46badea6d600d8515edea23814e03444d, \< f233d2be38dbbb22299192292983037f01ab363c; Linux 4.1.

### Is there a fix for CVE-2022-49945?

Yes. Fixed in Linux 3ff866455e1e263a9ac1958095fd440984248e2f, Linux 7756eb1ed124753f4d64f761fc3d84290dffcb4d, Linux 517dba798793e69b510779c3cde7224a65f3ed1d, Linux 53196e0376205ed49b75bfd0475af5e0fbd20156, Linux 3263984c7acdcb0658155b05a724ed45a10de76d. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49945?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/e9f6972ab40a82bd7f6d36800792ba2e084474d8>
- patch: <https://git.kernel.org/stable/c/3ff866455e1e263a9ac1958095fd440984248e2f>
- patch: <https://git.kernel.org/stable/c/c8ae6a18708f260ccdeef6ba53af7548457dc26c>
- patch: <https://git.kernel.org/stable/c/7756eb1ed124753f4d64f761fc3d84290dffcb4d>
- patch: <https://git.kernel.org/stable/c/517dba798793e69b510779c3cde7224a65f3ed1d>
- patch: <https://git.kernel.org/stable/c/53196e0376205ed49b75bfd0475af5e0fbd20156>
- patch: <https://git.kernel.org/stable/c/3263984c7acdcb0658155b05a724ed45a10de76d>
- patch: <https://git.kernel.org/stable/c/f233d2be38dbbb22299192292983037f01ab363c>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49945>

HTML: <https://flawdb.com/CVE-2022-49945> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49945>
