WebKit Bugzilla
Attachment 358663 Details for
Bug 192995
: Expand use of sourceApplicationAuditData
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192995-20190108203541.patch (text/plain), 11.57 KB, created by
Alex Christensen
on 2019-01-08 20:35:42 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-01-08 20:35:42 PST
Size:
11.57 KB
patch
obsolete
>Index: Source/WTF/ChangeLog >=================================================================== >--- Source/WTF/ChangeLog (revision 239760) >+++ Source/WTF/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2019-01-08 Alex Christensen <achristensen@webkit.org> >+ >+ Expand use of sourceApplicationAuditData >+ https://bugs.webkit.org/show_bug.cgi?id=192995 >+ <rdar://problem/46627875> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Platform.h: >+ > 2019-01-07 David Kilzer <ddkilzer@apple.com> > > Prefer RetainPtr<NSObject> to RetainPtr<NSObject *> >Index: Source/WTF/wtf/Platform.h >=================================================================== >--- Source/WTF/wtf/Platform.h (revision 239760) >+++ Source/WTF/wtf/Platform.h (working copy) >@@ -1359,6 +1359,10 @@ > #define HAVE_RSA_PSS 1 > #endif > >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY) >+#define USE_SOURCE_APPLICATION_AUDIT_DATA 1 >+#endif >+ > #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) || PLATFORM(IOSMAC) > #define HAVE_URL_FORMATTING 1 > #endif >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239760) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,25 @@ >+2019-01-08 Alex Christensen <achristensen@webkit.org> >+ >+ Expand use of sourceApplicationAuditData >+ https://bugs.webkit.org/show_bug.cgi?id=192995 >+ <rdar://problem/46627875> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ sourceApplicationAuditData has been used for a long time on iOS, but it's needed on more platforms. >+ I also made it return an Optional instead of a bool and returning by reference. Ahhh. So much nicer. >+ The NetworkProcess needed an additional entitlement on Mac to continue to load anything, which is desirable. >+ >+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm: >+ (WebKit::NetworkProcess::sourceApplicationAuditData const): >+ * Platform/IPC/Connection.h: >+ * Platform/IPC/mac/ConnectionMac.mm: >+ (IPC::Connection::getAuditToken): >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::initializeWebProcess): >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::WebProcess::sourceApplicationAuditData const): >+ > 2019-01-08 Alex Christensen <achristensen@webkit.org> > > Fix CompletionHandler assertions introduced today. >Index: Source/WebKit/Configurations/Network-OSX-restricted.entitlements >=================================================================== >--- Source/WebKit/Configurations/Network-OSX-restricted.entitlements (revision 239760) (from Source/WebKit/Configurations/Network-OSX.entitlements:239760) >+++ Source/WebKit/Configurations/Network-OSX-restricted.entitlements (working copy) >@@ -0,0 +1,5 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >+<plist version="1.0"> >+<dict/> >+</plist> >Index: Source/WebKit/Configurations/Network-OSX-restricted.entitlements >=================================================================== >--- Source/WebKit/Configurations/Network-OSX-restricted.entitlements (revision 239760) >+++ Source/WebKit/Configurations/Network-OSX-restricted.entitlements (working copy) >@@ -1,5 +1,8 @@ > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> > <plist version="1.0"> >-<dict/> >+<dict> >+ <key>com.apple.private.network.socket-delegate</key> >+ <true/> >+</dict> > </plist> >Index: Source/WebKit/Configurations/Network-OSX.entitlements >=================================================================== >--- Source/WebKit/Configurations/Network-OSX.entitlements (revision 239760) >+++ Source/WebKit/Configurations/Network-OSX.entitlements (working copy) >@@ -1,5 +1,8 @@ > <?xml version="1.0" encoding="UTF-8"?> > <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> > <plist version="1.0"> >-<dict/> >+<dict> >+ <key>com.apple.private.network.socket-delegate</key> >+ <true/> >+</dict> > </plist> >Index: Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm >=================================================================== >--- Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (revision 239760) >+++ Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (working copy) >@@ -133,12 +133,14 @@ void NetworkProcess::platformInitializeN > > RetainPtr<CFDataRef> NetworkProcess::sourceApplicationAuditData() const > { >-#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC) >- audit_token_t auditToken; >+#if USE(SOURCE_APPLICATION_AUDIT_DATA) > ASSERT(parentProcessConnection()); >- if (!parentProcessConnection() || !parentProcessConnection()->getAuditToken(auditToken)) >+ if (!parentProcessConnection()) > return nullptr; >- return adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken))); >+ Optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken(); >+ if (!auditToken) >+ return nullptr; >+ return adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken))); > #else > return nullptr; > #endif >Index: Source/WebKit/Platform/IPC/Connection.h >=================================================================== >--- Source/WebKit/Platform/IPC/Connection.h (revision 239760) >+++ Source/WebKit/Platform/IPC/Connection.h (working copy) >@@ -137,7 +137,7 @@ public: > }; > static bool identifierIsValid(Identifier identifier) { return MACH_PORT_VALID(identifier.port); } > xpc_connection_t xpcConnection() const { return m_xpcConnection.get(); } >- bool getAuditToken(audit_token_t&); >+ Optional<audit_token_t> getAuditToken(); > pid_t remoteProcessID() const; > #elif OS(WINDOWS) > typedef HANDLE Identifier; >Index: Source/WebKit/Platform/IPC/mac/ConnectionMac.mm >=================================================================== >--- Source/WebKit/Platform/IPC/mac/ConnectionMac.mm (revision 239760) >+++ Source/WebKit/Platform/IPC/mac/ConnectionMac.mm (working copy) >@@ -603,13 +603,14 @@ IPC::Connection::Identifier Connection:: > return Identifier(m_isServer ? m_receivePort : m_sendPort, m_xpcConnection); > } > >-bool Connection::getAuditToken(audit_token_t& auditToken) >+Optional<audit_token_t> Connection::getAuditToken() > { > if (!m_xpcConnection) >- return false; >+ return WTF::nullopt; > >+ audit_token_t auditToken; > xpc_connection_get_audit_token(m_xpcConnection.get(), &auditToken); >- return true; >+ return WTFMove(auditToken); > } > > bool Connection::kill() >Index: Source/WebKit/Scripts/process-network-sandbox-entitlements.sh >=================================================================== >--- Source/WebKit/Scripts/process-network-sandbox-entitlements.sh (revision 239760) >+++ Source/WebKit/Scripts/process-network-sandbox-entitlements.sh (working copy) >@@ -8,6 +8,11 @@ if [[ ${WK_PLATFORM_NAME} == "macosx" ]] > if [[ ${WK_USE_RESTRICTED_ENTITLEMENTS} == "YES" ]]; then > echo "Processing restricted entitlements for Internal SDK"; > >+ if (( ${TARGET_MAC_OS_X_VERSION_MAJOR} >= 101500 )); then >+ echo "Adding macOS platform entitlements."; >+ /usr/libexec/PlistBuddy -c "Merge Configurations/Network-OSX-restricted.entitlements" "${PROCESSED_XCENT_FILE}"; >+ fi >+ > echo "Adding sandbox entitlements for Network process."; > /usr/libexec/PlistBuddy -c "Merge Configurations/Network-OSX-sandbox.entitlements" "${PROCESSED_XCENT_FILE}"; > fi >Index: Source/WebKit/WebKit.xcodeproj/project.pbxproj >=================================================================== >--- Source/WebKit/WebKit.xcodeproj/project.pbxproj (revision 239760) >+++ Source/WebKit/WebKit.xcodeproj/project.pbxproj (working copy) >@@ -3448,6 +3448,7 @@ > 5C62FDF81EFC263C00CE072E /* WKURLSchemeTaskPrivate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKURLSchemeTaskPrivate.h; sourceTree = "<group>"; }; > 5C6CE6D01F59BC460007C6CB /* PageClientImplCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImplCocoa.mm; sourceTree = "<group>"; }; > 5C6CE6D31F59EA350007C6CB /* PageClientImplCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImplCocoa.h; sourceTree = "<group>"; }; >+ 5C6F4EED21E5B11300BC8380 /* Network-OSX-restricted.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Network-OSX-restricted.entitlements"; sourceTree = "<group>"; }; > 5C74300E21500492004BFA17 /* WKWebProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebProcess.h; sourceTree = "<group>"; }; > 5C74300F21500492004BFA17 /* WKWebProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebProcess.cpp; sourceTree = "<group>"; }; > 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketProvider.cpp; path = Network/WebSocketProvider.cpp; sourceTree = "<group>"; }; >@@ -4840,6 +4841,7 @@ > 1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */, > 37119A7D20CCB64E002C6DC9 /* Network-iOS-minimalsimulator.entitlements */, > 7C0BB9A918DCDF5A0006C086 /* Network-iOS.entitlements */, >+ 5C6F4EED21E5B11300BC8380 /* Network-OSX-restricted.entitlements */, > 41D0FC7D20E43A5100076AE8 /* Network-OSX-sandbox.entitlements */, > 5C7ACFD1218DD8BD004CBB59 /* Network-OSX.entitlements */, > BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */, >Index: Source/WebKit/WebProcess/WebProcess.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.cpp (revision 239760) >+++ Source/WebKit/WebProcess/WebProcess.cpp (working copy) >@@ -398,9 +398,8 @@ void WebProcess::initializeWebProcess(We > #endif > > #if ENABLE(REMOTE_INSPECTOR) && PLATFORM(COCOA) >- audit_token_t auditToken; >- if (parentProcessConnection()->getAuditToken(auditToken)) { >- RetainPtr<CFDataRef> auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken))); >+ if (Optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken()) { >+ RetainPtr<CFDataRef> auditData = adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken))); > Inspector::RemoteInspector::singleton().setParentProcessInformation(WebCore::presentingApplicationPID(), auditData); > } > #endif >Index: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >=================================================================== >--- Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (revision 239760) >+++ Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (working copy) >@@ -417,12 +417,14 @@ void WebProcess::platformTerminate() > > RetainPtr<CFDataRef> WebProcess::sourceApplicationAuditData() const > { >-#if PLATFORM(IOS_FAMILY) >- audit_token_t auditToken; >+#if USE(SOURCE_APPLICATION_AUDIT_DATA) > ASSERT(parentProcessConnection()); >- if (!parentProcessConnection() || !parentProcessConnection()->getAuditToken(auditToken)) >+ if (!parentProcessConnection()) >+ return nullptr; >+ Optional<audit_token_t> auditToken = parentProcessConnection()->getAuditToken(); >+ if (!auditToken) > return nullptr; >- return adoptCF(CFDataCreate(nullptr, (const UInt8*)&auditToken, sizeof(auditToken))); >+ return adoptCF(CFDataCreate(nullptr, (const UInt8*)&*auditToken, sizeof(*auditToken))); > #else > return nullptr; > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192995
:
357979
|
358658
|
358660
|
358662
|
358663
|
358671
|
358734
|
358736