Kernel: Limit the number of in-flight packet buffers

This fixes an OOM when hitting the VM with lots of UDP packets.

fixes #6907
This commit is contained in:
Gunnar Beutner 2021-05-06 20:22:57 +02:00 committed by Andreas Kling
commit f999d5a91a
Notes: sideshowbarker 2024-07-18 18:36:23 +09:00
2 changed files with 11 additions and 0 deletions

View file

@ -80,7 +80,11 @@ private:
Time timestamp;
};
// FIXME: Make this configurable
static constexpr size_t max_packet_buffers = 1024;
SinglyLinkedList<PacketWithTimestamp> m_packet_queue;
size_t m_packet_queue_size { 0 };
SinglyLinkedList<KBuffer> m_unused_packet_buffers;
size_t m_unused_packet_buffers_count { 0 };
String m_name;