In the Linux kernel, the following vulnerability has been resolved:
remoteproc: imxdsprproc: Add mutex protection for workqueue
The workqueue may execute late even after remoteproc is stopped or stopping, some resources (rpmsg device and endpoint) have been released in rprocstopsubdevices(), then rprocvqinterrupt() accessing these resources will cause kennel dump.
Call trace: virtqueueaddsplit+0x1ac/0x560 virtqueueaddinbuf+0x4c/0x60 rpmsgrecvdone+0x15c/0x294 vringinterrupt+0x6c/0xa4 rprocvqinterrupt+0x30/0x50 imxdsprprocvqwork+0x24/0x40 [imxdsprproc] processonework+0x1d0/0x354 workerthread+0x13c/0x470 kthread+0x154/0x160 retfromfork+0x10/0x20
Add mutex protection in imxdsprprocvqwork(), if the state is not running, then just skip calling rprocvqinterrupt().
Also the flush workqueue operation can't be added in rproc stop for the same reason. The call sequence is
rprocshutdown -> rprocstop ->rprocstopsubdevices ->rproc->ops->stop() ->imxdsprprocstop ->flushwork -> rprocvqinterrupt
The resource needed by rprocvqinterrupt has been released in rprocstopsubdevices, so flushwork is not safe to be called in imxdsprprocstop.
{ "vanir_signatures": [ { "id": "CVE-2022-50426-391aa651", "signature_type": "Function", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c", "function": "imx_dsp_rproc_stop" }, "deprecated": false, "digest": { "length": 726.0, "function_hash": "109041616076161892013800566044732070122" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4a3e1fa7a77838617bdbcd95127ce93a959fad44" }, { "id": "CVE-2022-50426-58eaa75e", "signature_type": "Function", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c", "function": "imx_dsp_rproc_vq_work" }, "deprecated": false, "digest": { "length": 200.0, "function_hash": "316185458787764825113542629514266994690" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@47e6ab07018edebf94ce873cf50a05ec76ff2dde" }, { "id": "CVE-2022-50426-671267a2", "signature_type": "Function", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c", "function": "imx_dsp_rproc_vq_work" }, "deprecated": false, "digest": { "length": 200.0, "function_hash": "316185458787764825113542629514266994690" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b9693304b7133b81741add5bfb56f022596df012" }, { "id": "CVE-2022-50426-6ba6ab79", "signature_type": "Line", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c" }, "deprecated": false, "digest": { "line_hashes": [ "161983909799124387316198074841990841336", "131102365320090944357726429402127524081", "145072722488787424867176051648114671868", "45077879115571602591725964682573626545", "28003119952307279637489924438306077087", "132116189381857797611254450795927144112", "312639363192262905365190295178850974840", "287676031523950389817024819615142502827", "227583499025433173409810861360476642095", "318347970876999607516713640403971027825" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@47e6ab07018edebf94ce873cf50a05ec76ff2dde" }, { "id": "CVE-2022-50426-82de5276", "signature_type": "Line", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c" }, "deprecated": false, "digest": { "line_hashes": [ "161983909799124387316198074841990841336", "131102365320090944357726429402127524081", "145072722488787424867176051648114671868", "45077879115571602591725964682573626545", "28003119952307279637489924438306077087", "132116189381857797611254450795927144112", "312639363192262905365190295178850974840", "287676031523950389817024819615142502827", "227583499025433173409810861360476642095", "318347970876999607516713640403971027825" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4a3e1fa7a77838617bdbcd95127ce93a959fad44" }, { "id": "CVE-2022-50426-86f30c2c", "signature_type": "Function", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c", "function": "imx_dsp_rproc_stop" }, "deprecated": false, "digest": { "length": 726.0, "function_hash": "109041616076161892013800566044732070122" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b9693304b7133b81741add5bfb56f022596df012" }, { "id": "CVE-2022-50426-91d4d4f2", "signature_type": "Line", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c" }, "deprecated": false, "digest": { "line_hashes": [ "161983909799124387316198074841990841336", "131102365320090944357726429402127524081", "145072722488787424867176051648114671868", "45077879115571602591725964682573626545", "28003119952307279637489924438306077087", "132116189381857797611254450795927144112", "312639363192262905365190295178850974840", "287676031523950389817024819615142502827", "227583499025433173409810861360476642095", "318347970876999607516713640403971027825" ], "threshold": 0.9 }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b9693304b7133b81741add5bfb56f022596df012" }, { "id": "CVE-2022-50426-a977c5d0", "signature_type": "Function", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c", "function": "imx_dsp_rproc_vq_work" }, "deprecated": false, "digest": { "length": 200.0, "function_hash": "316185458787764825113542629514266994690" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4a3e1fa7a77838617bdbcd95127ce93a959fad44" }, { "id": "CVE-2022-50426-ee5ae909", "signature_type": "Function", "target": { "file": "drivers/remoteproc/imx_dsp_rproc.c", "function": "imx_dsp_rproc_stop" }, "deprecated": false, "digest": { "length": 726.0, "function_hash": "109041616076161892013800566044732070122" }, "signature_version": "v1", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@47e6ab07018edebf94ce873cf50a05ec76ff2dde" } ] }