ladybird/Kernel/Net
Liav A 7c1f645e27 Kernel/Net: Iron out the locking mechanism across the subsystem
There is a big mix of LockRefPtrs all over the Networking subsystem, as
well as lots of room for improvements with our locking patterns, which
this commit will not pursue, but will give a good start for such work.

To deal with this situation, we change the following things:
- Creating instances of NetworkAdapter should always yield a non-locking
  NonnullRefPtr. Acquiring an instance from the NetworkingManagement
  should give a simple RefPtr,as giving LockRefPtr does not really
  protect from concurrency problems in such case.
- Since NetworkingManagement works with normal RefPtrs we should
  protect all instances of RefPtr<NetworkAdapter> with SpinlockProtected
  to ensure references are gone unexpectedly.
- Protect the so_error class member with a proper spinlock. This happens
  to be important because the clear_so_error() method lacked any proper
  locking measures. It also helps preventing a possible TOCTOU when we
  might do a more fine-grained locking in the Socket code, so this could
  be definitely a start for this.
- Change unnecessary LockRefPtr<PacketWithTimestamp> in the structure
  of OutgoingPacket to a simple RefPtr<PacketWithTimestamp> as the whole
  list should be MutexProtected.
2023-04-14 19:27:56 +02:00
..
Intel Kernel/Net: Convert initializers to return NonnullRefPtr<NetworkAdapter> 2023-04-14 19:27:56 +02:00
Realtek Kernel/Net: Convert initializers to return NonnullRefPtr<NetworkAdapter> 2023-04-14 19:27:56 +02:00
ARP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
EthernetFrameHeader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
EtherType.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ICMP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
IPv4.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
IPv4Socket.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
IPv4Socket.h Kernel: Use RefPtr instead of LockRefPtr for File and subclasses 2023-03-10 13:15:44 +01:00
IPv4SocketTuple.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
LocalSocket.cpp Kernel: Use RefPtr instead of LockRefPtr for File and subclasses 2023-03-10 13:15:44 +01:00
LocalSocket.h Kernel: Use RefPtr instead of LockRefPtr for File and subclasses 2023-03-10 13:15:44 +01:00
LoopbackAdapter.cpp Kernel/Net: Make the LoopbackAdapter initializer to use ErrorOr pattern 2023-04-14 19:27:56 +02:00
LoopbackAdapter.h Kernel/Net: Make the LoopbackAdapter initializer to use ErrorOr pattern 2023-04-14 19:27:56 +02:00
NetworkAdapter.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
NetworkAdapter.h Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
NetworkingManagement.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
NetworkingManagement.h Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
NetworkTask.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
NetworkTask.h Kernel: Avoid deadlock when trying to send packets from the NetworkTask 2021-04-30 23:11:56 +02:00
Routing.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
Routing.h Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
Socket.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
Socket.h Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
TCP.h Everywhere: Remove unused includes of AK/StdLibExtras.h 2023-01-02 20:27:20 -05:00
TCPSocket.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
TCPSocket.h Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
UDP.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
UDPSocket.cpp Kernel/Net: Iron out the locking mechanism across the subsystem 2023-04-14 19:27:56 +02:00
UDPSocket.h Kernel: Use RefPtr instead of LockRefPtr for File and subclasses 2023-03-10 13:15:44 +01:00