# CVE-2023-52629: sh: push-switch: Reorder cleanup operations to avoid use-after-free bug

- Severity: High 8.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.26%, higher than 18% of CVEs (2026-12-01)
- Published: 2024-03-29T09:13:45.848Z
- Modified: 2026-10-03T11:17:26.973Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

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

sh: push-switch: Reorder cleanup operations to avoid use-after-free bug

The original code puts flush_work() before timer_shutdown_sync()
in switch_drv_remove(). Although we use flush_work() to stop
the worker, it could be rescheduled in switch_timer(). As a result,
a use-after-free bug can occur. The details are shown below:

      (cpu 0)                    |      (cpu 1)
switch_drv_remove()              |
 flush_work()                    |
  ...                            |  switch_timer // timer
                                 |   schedule_work(&psw->work)
 timer_shutdown_sync()           |
 ...                             |  switch_work_handler // worker
 kfree(psw) // free              |
                                 |   psw->state = 0 // use

This patch puts timer_shutdown_sync() before flush_work() to
mitigate the bugs. As a result, the worker and timer will be
stopped safely before the deallocate operations.

(As written by CVE List.)

## Affected

- Linux Linux: from 9f5e8eee5cfe1328660c71812d87c2a67bda389f before ff635d1f143b55fa005e9e43b16e6d8f677e90a5; from 9f5e8eee5cfe1328660c71812d87c2a67bda389f before 610dbd8ac271aa36080aac50b928d700ee3fe4de; from 9f5e8eee5cfe1328660c71812d87c2a67bda389f before 246f80a0b17f8f582b2c0996db02998239057c65; 2.6.20 (not affected: before 2.6.20; from 6.1.189 up to 6.1.*; from 6.5.4 up to 6.5.*; from 6.6 up to *)
- linux linux_kernel: from 9f5e8eee5cfe before 610dbd8ac271; from 9f5e8eee5cfe before 246f80a0b17f; 2.6.20; from 2.6.20 before 6.5.4 (not affected: before 2.6.20; from 6.54 up to 6.6; up to 6.6)

## References

- <https://git.kernel.org/stable/c/ff635d1f143b55fa005e9e43b16e6d8f677e90a5>
- <https://git.kernel.org/stable/c/610dbd8ac271aa36080aac50b928d700ee3fe4de> (patch)
- <https://git.kernel.org/stable/c/246f80a0b17f8f582b2c0996db02998239057c65> (patch)

## Sources

- CVE List: [CVE-2023-52629](https://www.cve.org/CVERecord?id=CVE-2023-52629), CVE Terms of Use, modified 2026-10-03
- NVD: [CVE-2023-52629](https://nvd.nist.gov/vuln/detail/CVE-2023-52629), Public domain, modified 2026-10-03

---

Page: https://cve.day/CVE-2023-52629 · Whole record: https://cve.day/CVE-2023-52629.json · Rebuilt by cve.day 2026-11-25T22:58:33.436Z
