{"id":"CVE-2023-52629","revision":"0a2040fab0f84cef85bbedcefcb4da0b","records":[{"revision":"0a2040fab0f84cef85bbedcefcb4da0b","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2023-52629","aliases":[],"title":"sh: push-switch: Reorder cleanup operations to avoid use-after-free bug","description":"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.","state":0,"publishedAt":"2024-03-29T09:13:45.848+00:00","modifiedAt":"2026-10-03T10:54:49.171+00:00","affected":[{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"unaffected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"arch/sh/drivers/push-switch.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"9f5e8eee5cfe1328660c71812d87c2a67bda389f\",\n                            \"lessThan\": \"ff635d1f143b55fa005e9e43b16e6d8f677e90a5\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"9f5e8eee5cfe1328660c71812d87c2a67bda389f\",\n                            \"lessThan\": \"610dbd8ac271aa36080aac50b928d700ee3fe4de\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        },\n                        {\n                            \"version\": \"9f5e8eee5cfe1328660c71812d87c2a67bda389f\",\n                            \"lessThan\": \"246f80a0b17f8f582b2c0996db02998239057c65\",\n                            \"status\": \"affected\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"Linux","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"Linux\",\n                    \"vendor\": \"Linux\",\n                    \"defaultStatus\": \"affected\",\n                    \"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\n                    \"programFiles\": [\n                        \"arch/sh/drivers/push-switch.c\"\n                    ],\n                    \"versions\": [\n                        {\n                            \"version\": \"2.6.20\",\n                            \"status\": \"affected\"\n                        },\n                        {\n                            \"version\": \"0\",\n                            \"lessThan\": \"2.6.20\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.1.189\",\n                            \"lessThanOrEqual\": \"6.1.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.5.4\",\n                            \"lessThanOrEqual\": \"6.5.*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"semver\"\n                        },\n                        {\n                            \"version\": \"6.6\",\n                            \"lessThanOrEqual\": \"*\",\n                            \"status\": \"unaffected\",\n                            \"versionType\": \"original_commit_for_fix\"\n                        }\n                    ]\n                }"}],"metrics":[],"references":["https://git.kernel.org/stable/c/ff635d1f143b55fa005e9e43b16e6d8f677e90a5","https://git.kernel.org/stable/c/610dbd8ac271aa36080aac50b928d700ee3fe4de","https://git.kernel.org/stable/c/246f80a0b17f8f582b2c0996db02998239057c65"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2023-52629","license":"CVE Program Terms of Use","key":"cve-program:CVE-2023-52629","identifiers":["CVE-2023-52629"]},"retained":false,"historicalAffected":[]}],"coverage":[]}