In the Linux kernel, the following vulnerability has been resolved:
scsi: libsas: Fix use-after-free bug in smpexecutetask_sg()
When executing SMP task failed, the smpexecutetasksg() calls deltimer() to delete "slowtask->timer". However, if the timer handler sastaskinternaltimedout() is running, the deltimer() in smpexecutetasksg() will not stop it and a UAF will happen. The process is shown below:
(thread 1) | (thread 2)
smpexecutetasksg() | sastaskinternaltimedout() ... | deltimer() | ... | ... sasfreetask(task) | kfree(task->slowtask) //FREE| | task->slow_task->... //USE
Fix by calling deltimersync() in smpexecutetasksg(), which makes sure the timer handler have finished before the "task->slowtask" is deallocated.
{ "vanir_signatures": [ { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/scsi/libsas/sas_expander.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "186346734633314153353763738193297759084", "141327633564149950305551306113509126187", "91272386166697800953521242895833488199", "185122577366581753554829713247834856661" ], "threshold": 0.9 }, "id": "CVE-2022-50422-4ddee16d", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a9e5176ead6de64f572ad5c87a72825d9d3c82ae" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/scsi/libsas/sas_expander.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "186346734633314153353763738193297759084", "141327633564149950305551306113509126187", "91272386166697800953521242895833488199", "185122577366581753554829713247834856661" ], "threshold": 0.9 }, "id": "CVE-2022-50422-94fbdc92", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@117331a2a5227fb4369c2a1f321d3e3e2e2ef8fe" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/scsi/libsas/sas_expander.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "186346734633314153353763738193297759084", "141327633564149950305551306113509126187", "91272386166697800953521242895833488199", "185122577366581753554829713247834856661" ], "threshold": 0.9 }, "id": "CVE-2022-50422-c48c140b", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2e12ce270f0d926085c1209cc90397e307deef97" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/scsi/libsas/sas_expander.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "186346734633314153353763738193297759084", "141327633564149950305551306113509126187", "91272386166697800953521242895833488199", "185122577366581753554829713247834856661" ], "threshold": 0.9 }, "id": "CVE-2022-50422-c6f2521d", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e45a1516d2933703a4823d9db71e17c3abeba24f" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/scsi/libsas/sas_expander.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "186346734633314153353763738193297759084", "141327633564149950305551306113509126187", "91272386166697800953521242895833488199", "185122577366581753554829713247834856661" ], "threshold": 0.9 }, "id": "CVE-2022-50422-e350625f", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@46ba53c30666717cb06c2b3c5d896301cd00d0c0" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/scsi/libsas/sas_expander.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "186346734633314153353763738193297759084", "141327633564149950305551306113509126187", "91272386166697800953521242895833488199", "185122577366581753554829713247834856661" ], "threshold": 0.9 }, "id": "CVE-2022-50422-f362fd44", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f7a785177611ffc97d645fcbc196e6de6ad2421d" } ] }