ladybird/Kernel/Devices/USB
Brian Gianforcaro d76dedb381 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: #6154
2021-05-15 09:46:41 +02:00
..
UHCIController.cpp Kernel: Fix UHCIController singleton startup null-deref race condition. 2021-05-15 09:46:41 +02:00
UHCIController.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
UHCIDescriptorTypes.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00