# CVE-2023-52797: drivers: perf: Check find\_first\_bit() return value

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; 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.30% (percentile 16, 2026-11-26)
- **CWE:** CWE-252
- **Published:** 2024-05-21T15:31:10.952Z
- **Modified:** 2026-06-17T06:43:36.143Z

## Who should check

- Anyone running Linux \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 2c86b24095fcf72cf51bc72d12e4350163b4e11d; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 45a0de41ec383c8b7c6d442734ba3852dd2fc4a7; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< c6e316ac05532febb0c966fa9b55f5258ed037be
- Anyone running Linux 5.18

## Description

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

drivers: perf: Check find\_first\_bit() return value

We must check the return value of find\_first\_bit() before using the
return value as an index array since it happens to overflow the array
and then panic:

\[  107.318430\] Kernel BUG \[\#1\]
\[  107.319434\] CPU: 3 PID: 1238 Comm: kill Tainted: G            E      6.6.0-rc6ubuntu-defconfig \#2
\[  107.319465\] Hardware name: riscv-virtio,qemu (DT)
\[  107.319551\] epc : pmu\_sbi\_ovf\_handler+0x3a4/0x3ae
\[  107.319840\]  ra : pmu\_sbi\_ovf\_handler+0x52/0x3ae
\[  107.319868\] epc : ffffffff80a0a77c ra : ffffffff80a0a42a sp : ffffaf83fecda350
\[  107.319884\]  gp : ffffffff823961a8 tp : ffffaf8083db1dc0 t0 : ffffaf83fecda480
\[  107.319899\]  t1 : ffffffff80cafe62 t2 : 000000000000ff00 s0 : ffffaf83fecda520
\[  107.319921\]  s1 : ffffaf83fecda380 a0 : 00000018fca29df0 a1 : ffffffffffffffff
\[  107.319936\]  a2 : 0000000001073734 a3 : 0000000000000004 a4 : 0000000000000000
\[  107.319951\]  a5 : 0000000000000040 a6 : 000000001d1c8774 a7 : 0000000000504d55
\[  107.319965\]  s2 : ffffffff82451f10 s3 : ffffffff82724e70 s4 : 000000000000003f
\[  107.319980\]  s5 : 0000000000000011 s6 : ffffaf8083db27c0 s7 : 0000000000000000
\[  107.319995\]  s8 : 0000000000000001 s9 : 00007fffb45d6558 s10: 00007fffb45d81a0
\[  107.320009\]  s11: ffffaf7ffff60000 t3 : 0000000000000004 t4 : 0000000000000000
\[  107.320023\]  t5 : ffffaf7f80000000 t6 : ffffaf8000000000
\[  107.320037\] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003
\[  107.320081\] \[\<ffffffff80a0a77c\>\] pmu\_sbi\_ovf\_handler+0x3a4/0x3ae
\[  107.320112\] \[\<ffffffff800b42d0\>\] handle\_percpu\_devid\_irq+0x9e/0x1a0
\[  107.320131\] \[\<ffffffff800ad92c\>\] generic\_handle\_domain\_irq+0x28/0x36
\[  107.320148\] \[\<ffffffff8065f9f8\>\] riscv\_intc\_irq+0x36/0x4e
\[  107.320166\] \[\<ffffffff80caf4a0\>\] handle\_riscv\_irq+0x54/0x86
\[  107.320189\] \[\<ffffffff80cb0036\>\] do\_irq+0x64/0x96
\[  107.320271\] Code: 85a6 855e b097 ff7f 80e7 9220 b709 9002 4501 bbd9 (9002) 6097
\[  107.320585\] ---\[ end trace 0000000000000000 \]---
\[  107.320704\] Kernel panic - not syncing: Fatal exception in interrupt
\[  107.320775\] SMP: stopping secondary CPUs
\[  107.321219\] Kernel Offset: 0x0 from 0xffffffff80000000
\[  107.333051\] ---\[ end Kernel panic - not syncing: Fatal exception in interrupt \]---

## Affected and fixed versions

- Linux: \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 2c86b24095fcf72cf51bc72d12e4350163b4e11d; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 45a0de41ec383c8b7c6d442734ba3852dd2fc4a7; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< c6e316ac05532febb0c966fa9b55f5258ed037be (cvelist)
- Linux: 5.18 (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-2023-52797. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52797.md
Affected: Linux >= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, < 2c86b24095fcf72cf51bc72d12e4350163b4e11d; >= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, < 45a0de41ec383c8b7c6d442734ba3852dd2fc4a7; >= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, < c6e316ac05532febb0c966fa9b55f5258ed037be; Linux 5.18
Fixed in: Linux 2c86b24095fcf72cf51bc72d12e4350163b4e11d, Linux 45a0de41ec383c8b7c6d442734ba3852dd2fc4a7

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-2023-52797 being exploited?

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

### How serious is CVE-2023-52797?

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

### Which versions are affected by CVE-2023-52797?

Linux \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 2c86b24095fcf72cf51bc72d12e4350163b4e11d; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< 45a0de41ec383c8b7c6d442734ba3852dd2fc4a7; \>= 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98, \< c6e316ac05532febb0c966fa9b55f5258ed037be; Linux 5.18.

### Is there a fix for CVE-2023-52797?

Yes. Fixed in Linux 2c86b24095fcf72cf51bc72d12e4350163b4e11d, Linux 45a0de41ec383c8b7c6d442734ba3852dd2fc4a7. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-52797?

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/2c86b24095fcf72cf51bc72d12e4350163b4e11d>
- patch: <https://git.kernel.org/stable/c/45a0de41ec383c8b7c6d442734ba3852dd2fc4a7>
- patch: <https://git.kernel.org/stable/c/c6e316ac05532febb0c966fa9b55f5258ed037be>

## 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-2023-52797>

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