{"id":"CVE-2023-52629","published":"2024-03-29T09:13:45Z","modified":"2026-10-03T10:54:49Z","title":"sh: push-switch: Reorder cleanup operations to avoid use-after-free bug","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nsh: push-switch: Reorder cleanup operations to avoid use-after-free bug\n\nThe original code puts flush_work() before timer_shutdown_sync()\nin switch_drv_remove(). Although we use flush_work() to stop\nthe worker, it could be rescheduled in switch_timer(). As a result,\na use-after-free bug can occur. The details are shown below:\n\n      (cpu 0)                    |      (cpu 1)\nswitch_drv_remove()              |\n flush_work()                    |\n  ...                            |  switch_timer // timer\n                                 |   schedule_work(&psw->work)\n timer_shutdown_sync()           |\n ...                             |  switch_work_handler // worker\n kfree(psw) // free              |\n                                 |   psw->state = 0 // use\n\nThis patch puts timer_shutdown_sync() before flush_work() to\nmitigate the bugs. As a result, the worker and timer will be\nstopped safely before the deallocate operations.","provenance":"source","from":"CVE.org"},"cvss":{"score":8.4,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.00254,"percentile":0.17226,"provenance":"source"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"references":[{"url":"https://git.kernel.org/stable/c/ff635d1f143b55fa005e9e43b16e6d8f677e90a5","tags":[]},{"url":"https://git.kernel.org/stable/c/610dbd8ac271aa36080aac50b928d700ee3fe4de","tags":[]},{"url":"https://git.kernel.org/stable/c/246f80a0b17f8f582b2c0996db02998239057c65","tags":[]}],"priority":{"score":9.3,"factors":[{"name":"EPSS percentile","points":3.45},{"name":"CVSS severity","points":5.88}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 9f5e8eee5cfe1328660c71812d87c2a67bda389f, < ff635d1f143b55fa005e9e43b16e6d8f677e90a5",">= 9f5e8eee5cfe1328660c71812d87c2a67bda389f, < 610dbd8ac271aa36080aac50b928d700ee3fe4de",">= 9f5e8eee5cfe1328660c71812d87c2a67bda389f, < 246f80a0b17f8f582b2c0996db02998239057c65"]},{"vendor":"Linux","product":"Linux","versions":["2.6.20"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-04-01T17:41:22.649775Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2023-57253","exploited":false,"provenance":"source"}}