ladybird/Kernel/Devices
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
..
HID Kernel: Make UserOrKernelBuffer R/W helpers return KResultOr<size_t> 2021-05-13 23:28:40 +02:00
USB Kernel: Fix UHCIController singleton startup null-deref race condition. 2021-05-15 09:46:41 +02:00
AsyncDeviceRequest.cpp Everywhere: Use "the SerenityOS developers." in copyright headers 2021-04-29 00:59:26 +02:00
AsyncDeviceRequest.h Kernel: Make UserOrKernelBuffer R/W helpers return KResultOr<size_t> 2021-05-13 23:28:40 +02:00
BlockDevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BlockDevice.h Kernel: Mark AsyncBlockDeviceRequest + AnonymousVMObject as final 2021-05-03 16:03:17 +02:00
BXVGADevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BXVGADevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CharacterDevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CharacterDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Device.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Device.h AK: Rename adopt() to adopt_ref() 2021-04-23 16:46:57 +02:00
FullDevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FullDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MBVGADevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MBVGADevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MemoryDevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
MemoryDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
NullDevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
NullDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
PCSpeaker.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
PCSpeaker.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
RandomDevice.cpp Kernel: Make UserOrKernelBuffer R/W helpers return KResultOr<size_t> 2021-05-13 23:28:40 +02:00
RandomDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SB16.cpp Kernel: Make AnonymousVMObject physical page APIs OOM safe 2021-05-15 09:01:32 +02:00
SB16.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SerialDevice.cpp Kernel: Make UserOrKernelBuffer R/W helpers return KResultOr<size_t> 2021-05-13 23:28:40 +02:00
SerialDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
VMWareBackdoor.cpp Kernel: Remove unused header includes from various files. 2021-05-03 16:03:17 +02:00
VMWareBackdoor.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ZeroDevice.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ZeroDevice.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00