mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:55:08 +00:00
Kernel: Lock socket Mutex when servicing IPv4Socket ioctls
This prevents a kernel panic found in CI when m_receive_queue's size is queried and found to be non-zero, then a different thread clears the queue, and finally the first thread continues into the if block and calls the queue's first() method, which then fails an assertion that the queue's size is non-zero.
This commit is contained in:
parent
b5d891ed6a
commit
ead8ac8972
1 changed files with 2 additions and 0 deletions
|
@ -609,6 +609,8 @@ ErrorOr<void> IPv4Socket::ioctl(OpenFileDescription&, unsigned request, Userspac
|
|||
{
|
||||
TRY(Process::current().require_promise(Pledge::inet));
|
||||
|
||||
MutexLocker locker(mutex());
|
||||
|
||||
auto ioctl_route = [request, arg]() -> ErrorOr<void> {
|
||||
auto user_route = static_ptr_cast<rtentry*>(arg);
|
||||
rtentry route;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue