[webkit-changes] [WebKit/WebKit] 570527: Stop using NSKeyedUnarchiver for IPC on platforms ...

Alex Christensen noreply at github.com
Mon Jan 6 13:42:42 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 57052761f12cac99419741ade11be63a170f01b3
      https://github.com/WebKit/WebKit/commit/57052761f12cac99419741ade11be63a170f01b3
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2025-01-06 (Mon, 06 Jan 2025)

  Changed paths:
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Scripts/webkit/tests/GeneratedWebKitSecureCoding.cpp
    M Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp
    M Source/WebKit/Scripts/webkit/tests/TestSerializedType.serialization.in
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h
    M Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.serialization.in
    M Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.h
    M Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCNSValue.h
    M Source/WebKit/Shared/Cocoa/CoreIPCNSValue.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCNSValue.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCPKSecureElementPass.h
    A Source/WebKit/Shared/Cocoa/CoreIPCPKSecureElementPass.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCPassKit.serialization.in
    M Source/WebKit/Shared/Cocoa/CoreIPCRetainPtr.h
    M Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.h
    M Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.serialization.in
    M Source/WebKit/Shared/Cocoa/CoreIPCTypes.h
    M Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.serialization.in
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm

  Log Message:
  -----------
  Stop using NSKeyedUnarchiver for IPC on platforms that have the needed ObjC support
https://bugs.webkit.org/show_bug.cgi?id=285356
rdar://142327308

Reviewed by Brady Eidson.

To do this I needed to do a few things:
1. I needed to make CoreIPCPKSecureElementPass which continues to use NSKU under
the hood, but with a runtime verification that it is only used to send a
PKSecureElementPass into the web content process, so it can't be use to escape
the web content process.
2. I added a few more types to the NSType enumeration to replace SecureCoding.
3. I use a CoreIPCNSCFObject instead of a CoreIPCSecureCoding to store and serialize
the non-NSRange and non-NSRect possibilities in a CoreIPCNSValue.  This can probably
be tightened later, but for now it is not expanding the IPC possibilities that
are reachable by serializing an NSValue.
Now our IPC surface area has no ObjC types as primitive types on new platforms!

* Source/WebKit/Scripts/generate-serializers.py:
(generate_webkit_secure_coding_impl):
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h:
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::typeFromObject):
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h:
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm:
(WebKit::valueFromID):
(WebKit::CoreIPCNSCFObject::valueIsAllowed):
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.serialization.in:
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.h:
* Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.mm:
* Source/WebKit/Shared/Cocoa/CoreIPCNSValue.h:
* Source/WebKit/Shared/Cocoa/CoreIPCNSValue.mm:
(WebKit::CoreIPCNSValue::valueFromNSValue):
(WebKit::CoreIPCNSValue::toID const):
(WebKit::CoreIPCNSValue::shouldWrapValue): Deleted.
* Source/WebKit/Shared/Cocoa/CoreIPCNSValue.serialization.in:
* Source/WebKit/Shared/Cocoa/CoreIPCPKSecureElementPass.h: Copied from Source/WebKit/Shared/Cocoa/CoreIPCRetainPtr.h.
(WebKit::CoreIPCPKSecureElementPass::CoreIPCPKSecureElementPass):
(WebKit::CoreIPCPKSecureElementPass::ipcData const):
* Source/WebKit/Shared/Cocoa/CoreIPCPKSecureElementPass.mm: Copied from Source/WebKit/Shared/Cocoa/CoreIPCNSShadow.mm.
(WebKit::CoreIPCPKSecureElementPass::CoreIPCPKSecureElementPass):
(WebKit::CoreIPCPKSecureElementPass::toID const):
* Source/WebKit/Shared/Cocoa/CoreIPCPassKit.serialization.in:
* Source/WebKit/Shared/Cocoa/CoreIPCRetainPtr.h:
* Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.h:
* Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.mm:
(WebKit::conformsToWebKitSecureCoding):
(WebKit::CoreIPCSecureCoding::conformsToWebKitSecureCoding): Deleted.
(WebKit::CoreIPCSecureCoding::conformsToSecureCoding): Deleted.
* Source/WebKit/Shared/Cocoa/CoreIPCSecureCoding.serialization.in:
* Source/WebKit/Shared/Cocoa/CoreIPCTypes.h:
* Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.serialization.in:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm:
(SerializedTypeInfo)):

Canonical link: https://commits.webkit.org/288484@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list