Title: [287313] trunk/Source/WebKit
- Revision
- 287313
- Author
- [email protected]
- Date
- 2021-12-21 06:07:08 -0800 (Tue, 21 Dec 2021)
Log Message
IPC streams should not accept 0-length stream buffers
https://bugs.webkit.org/show_bug.cgi?id=234552
<rdar://79725420>
Patch by Kimmo Kinnunen <[email protected]> on 2021-12-21
Reviewed by Antti Koivisto.
Make decoding 0-length stream buffers fail. These buffers are not useful.
No new tests, tests need additional implementation, will be added
in subsequent commits.
* Platform/IPC/StreamConnectionBuffer.cpp:
(IPC::StreamConnectionBuffer::StreamConnectionBuffer):
(IPC::StreamConnectionBuffer::decode):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (287312 => 287313)
--- trunk/Source/WebKit/ChangeLog 2021-12-21 13:29:39 UTC (rev 287312)
+++ trunk/Source/WebKit/ChangeLog 2021-12-21 14:07:08 UTC (rev 287313)
@@ -1,3 +1,20 @@
+2021-12-21 Kimmo Kinnunen <[email protected]>
+
+ IPC streams should not accept 0-length stream buffers
+ https://bugs.webkit.org/show_bug.cgi?id=234552
+ <rdar://79725420>
+
+ Reviewed by Antti Koivisto.
+
+ Make decoding 0-length stream buffers fail. These buffers are not useful.
+
+ No new tests, tests need additional implementation, will be added
+ in subsequent commits.
+
+ * Platform/IPC/StreamConnectionBuffer.cpp:
+ (IPC::StreamConnectionBuffer::StreamConnectionBuffer):
+ (IPC::StreamConnectionBuffer::decode):
+
2021-12-20 Wenson Hsieh <[email protected]>
Add ModalContainerControlClassifier and use it to implement classifyModalContainerControls()
Modified: trunk/Source/WebKit/Platform/IPC/StreamConnectionBuffer.cpp (287312 => 287313)
--- trunk/Source/WebKit/Platform/IPC/StreamConnectionBuffer.cpp 2021-12-21 13:29:39 UTC (rev 287312)
+++ trunk/Source/WebKit/Platform/IPC/StreamConnectionBuffer.cpp 2021-12-21 14:07:08 UTC (rev 287313)
@@ -42,6 +42,7 @@
: m_dataSize(memorySize - headerSize())
, m_sharedMemory(createMemory(memorySize))
{
+ ASSERT(m_dataSize > 0);
ASSERT(m_dataSize <= maximumSize());
}
@@ -50,6 +51,7 @@
, m_sharedMemory(WTFMove(memory))
, m_clientWaitSemaphore(WTFMove(clientWaitSemaphore))
{
+ ASSERT(m_dataSize > 0);
ASSERT(m_dataSize <= maximumSize());
}
@@ -88,7 +90,7 @@
if (!semaphore)
return std::nullopt;
size_t dataSize = static_cast<size_t>(ipcHandle->dataSize);
- if (dataSize < headerSize())
+ if (dataSize <= headerSize())
return std::nullopt;
if (dataSize > headerSize() + maximumSize())
return std::nullopt;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes