浏览代码

Kernel: Zero-initialize LocalSocket::m_address

It was possible to read uninitialized kernel memory via getsockname().
Of course, kmalloc() is a good boy and scrubs new allocations with 0xBB
so all you got was a bunch of 0xBB.
Andreas Kling 5 年之前
父节点
当前提交
67950c80c8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/Net/LocalSocket.h

+ 1 - 1
Kernel/Net/LocalSocket.h

@@ -91,7 +91,7 @@ private:
 
 
     bool m_bound { false };
     bool m_bound { false };
     bool m_accept_side_fd_open { false };
     bool m_accept_side_fd_open { false };
-    sockaddr_un m_address;
+    sockaddr_un m_address { 0, { 0 } };
 
 
     DoubleBuffer m_for_client;
     DoubleBuffer m_for_client;
     DoubleBuffer m_for_server;
     DoubleBuffer m_for_server;