Title: [262546] trunk/Source
- Revision
- 262546
- Author
- [email protected]
- Date
- 2020-06-04 11:04:38 -0700 (Thu, 04 Jun 2020)
Log Message
[Cocoa] Adopt read-only mode for preferences in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=212411
Source/WebCore/PAL:
Reviewed by Darin Adler.
* pal/spi/cf/CFUtilitiesSPI.h:
Source/WebKit:
<rdar://problem/63640788>
Reviewed by Darin Adler.
The WebContent process should never write preferences. Adopt read-only mode for preferences.
This will fix some sandbox violations when the UI process is notifying the WebContent process
about preference changes. When notified, the WebContent process will use the preferences API
to write those preferences in-process, but there should be no attempt at writing these new
values to disk, which this patch will ensure.
No new tests, since this is fixing a benign sandbox violation.
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
Source/WTF:
Reviewed by Darin Adler.
Create HAVE define indicating support for read-only preference SPI.
* wtf/PlatformHave.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (262545 => 262546)
--- trunk/Source/WTF/ChangeLog 2020-06-04 17:33:24 UTC (rev 262545)
+++ trunk/Source/WTF/ChangeLog 2020-06-04 18:04:38 UTC (rev 262546)
@@ -1,3 +1,14 @@
+2020-06-04 Per Arne Vollan <[email protected]>
+
+ [Cocoa] Adopt read-only mode for preferences in the WebContent process
+ https://bugs.webkit.org/show_bug.cgi?id=212411
+
+ Reviewed by Darin Adler.
+
+ Create HAVE define indicating support for read-only preference SPI.
+
+ * wtf/PlatformHave.h:
+
2020-06-04 Tim Horton <[email protected]>
Work around broken system version macro
Modified: trunk/Source/WTF/wtf/PlatformHave.h (262545 => 262546)
--- trunk/Source/WTF/wtf/PlatformHave.h 2020-06-04 17:33:24 UTC (rev 262545)
+++ trunk/Source/WTF/wtf/PlatformHave.h 2020-06-04 18:04:38 UTC (rev 262546)
@@ -641,3 +641,10 @@
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
#define HAVE_LOGGING_PRIVACY_LEVEL 1
#endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) \
+ || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) \
+ || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 70000) \
+ || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 140000)
+#define HAVE_CFPREFS_READONLY_SPI 1
+#endif
Modified: trunk/Source/WebCore/PAL/ChangeLog (262545 => 262546)
--- trunk/Source/WebCore/PAL/ChangeLog 2020-06-04 17:33:24 UTC (rev 262545)
+++ trunk/Source/WebCore/PAL/ChangeLog 2020-06-04 18:04:38 UTC (rev 262546)
@@ -1,3 +1,12 @@
+2020-06-04 Per Arne Vollan <[email protected]>
+
+ [Cocoa] Adopt read-only mode for preferences in the WebContent process
+ https://bugs.webkit.org/show_bug.cgi?id=212411
+
+ Reviewed by Darin Adler.
+
+ * pal/spi/cf/CFUtilitiesSPI.h:
+
2020-06-04 Tim Horton <[email protected]>
Work around broken system version macro
Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h (262545 => 262546)
--- trunk/Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h 2020-06-04 17:33:24 UTC (rev 262545)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h 2020-06-04 18:04:38 UTC (rev 262546)
@@ -59,5 +59,6 @@
void __CFRunLoopSetOptionsReason(__CFRunLoopOptions opts, CFStringRef reason);
void _CFPrefsSetDirectModeEnabled(bool enabled);
+void _CFPrefsSetReadOnly(bool flag);
WTF_EXTERN_C_END
Modified: trunk/Source/WebKit/ChangeLog (262545 => 262546)
--- trunk/Source/WebKit/ChangeLog 2020-06-04 17:33:24 UTC (rev 262545)
+++ trunk/Source/WebKit/ChangeLog 2020-06-04 18:04:38 UTC (rev 262546)
@@ -1,5 +1,24 @@
2020-06-04 Per Arne Vollan <[email protected]>
+ [Cocoa] Adopt read-only mode for preferences in the WebContent process
+ https://bugs.webkit.org/show_bug.cgi?id=212411
+ <rdar://problem/63640788>
+
+ Reviewed by Darin Adler.
+
+ The WebContent process should never write preferences. Adopt read-only mode for preferences.
+ This will fix some sandbox violations when the UI process is notifying the WebContent process
+ about preference changes. When notified, the WebContent process will use the preferences API
+ to write those preferences in-process, but there should be no attempt at writing these new
+ values to disk, which this patch will ensure.
+
+ No new tests, since this is fixing a benign sandbox violation.
+
+ * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
+ (WebKit::XPCServiceMain):
+
+2020-06-04 Per Arne Vollan <[email protected]>
+
[iOS] The WebContent process should be allowed to consume an extension to the runningboard service
https://bugs.webkit.org/show_bug.cgi?id=212753
<rdar://problem/63948859>
Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm (262545 => 262546)
--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm 2020-06-04 17:33:24 UTC (rev 262545)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm 2020-06-04 18:04:38 UTC (rev 262546)
@@ -122,6 +122,9 @@
if (argc >= 1 && argv[0] && strstr(argv[0], "com.apple.WebKit.WebContent")) {
// Enable CFPrefs direct mode to avoid unsuccessfully attempting to connect to the daemon and getting blocked by the sandbox.
_CFPrefsSetDirectModeEnabled(YES);
+#if HAVE(CFPREFS_READONLY_SPI)
+ _CFPrefsSetReadOnly(YES);
+#endif
}
#else
UNUSED_PARAM(argc);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes