Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kernel: Fix UHCIController singleton startup null-deref race condition.
The following KUBSAN crash on startup was reported on discord: ``` UHCI: Started KUBSAN: reference binding to null pointer of type struct UHCIController KUBSAN: at ../../Kernel/Devices/USB/UHCIController.cpp, line 67 ``` After inspecting the code, it became clear that there's a window of time where the kernel task which monitors the UHCI port can startup and start executing before the UHCIController constructor completes. This leaves the singleton pointing to nullptr, thus in the duration of this race window the "UHCI port proc" thread will go an and de-reference the null pointer when trying to read for status changes on the UHCI root ports. Reported-by: @stelar7 Reported-by: @bcoles Fixes: SerenityOS#6154
- Loading branch information