⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 170686 in webkit


Ignore:
Timestamp:
Jul 1, 2014, 6:24:17 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r170608.
​https://bugs.webkit.org/show_bug.cgi?id=134533

Safari keeps crashing on device due to sandbox violation.
(Requested by enrica on #webkit).

Reverted changeset:

"Restrict network process sandbox"
​https://bugs.webkit.org/show_bug.cgi?id=134360
​http://trac.webkit.org/changeset/170608

Location:
trunk/Source/WebKit2
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r170685 r170686  
     12014-07-01  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r170608.
     4        https://bugs.webkit.org/show_bug.cgi?id=134533
     5
     6        Safari keeps crashing on device due to sandbox violation.
     7        (Requested by enrica on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Restrict network process sandbox"
     12        https://bugs.webkit.org/show_bug.cgi?id=134360
     13        http://trac.webkit.org/changeset/170608
     14
    1152014-07-01  Pratik Solanki  <psolanki@apple.com>
    216
  • trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm

    r170608 r170686  
    6161void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessCreationParameters& parameters)
    6262{
    63     SandboxExtension::consumePermanently(parameters.cookieStorageDirectoryExtensionHandle);
     63#if PLATFORM(IOS)
     64    if (!parameters.uiProcessBundleIdentifier.isNull()) {
     65        [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
     66            _initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity
     67            diskCapacity:parameters.nsURLCacheDiskCapacity
     68            relativePath:parameters.uiProcessBundleIdentifier]).get()];
     69    }
     70#else
    6471    m_diskCacheDirectory = parameters.diskCacheDirectory;
    6572
    6673    if (!m_diskCacheDirectory.isNull()) {
    6774        SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
    68 #if PLATFORM(IOS)
    69         [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
    70             _initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity
    71             diskCapacity:parameters.nsURLCacheDiskCapacity
    72             relativePath:parameters.uiProcessBundleIdentifier]).get()];
    73 #else
    7475        [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
    7576            initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity
    7677            diskCapacity:parameters.nsURLCacheDiskCapacity
    7778            diskPath:parameters.diskCacheDirectory]).get()];
     79    }
    7880#endif
    79     }
    8081
    8182#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  • trunk/Source/WebKit2/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb

    r170608 r170686  
    2323
    2424(version 1)
    25 (deny default (with partial-symbolication))
    26 (allow system-audit file-read-metadata)
     25(allow default)
    2726
    2827(import "common.sb")
    2928(import "removed-dev-nodes.sb")
    30 
    31 ;; Access CFNetwork shared cookies
    32 ;; This is too generous -- <rdar://problem/17496756>
    33 (apple-cookie-access 'with-read-write)
    34 
    35 ;; Sandbox extensions
    36 (allow file-read* (container-subpath "Library/")
    37        (extension "com.apple.webkit.read"))
    38 
    39 ;; Access to client's cache folder & re-vending to CFNetwork.
    40 (allow file-read* file-write* (container-subpath "Library/")
    41        (extension "com.apple.nsurlstorage.extension-cache"))
    42 (allow file-issue-extension  (container-subpath "Library/")
    43        (extension-class "com.apple.nsurlstorage.extension-cache"))
    44 
    45 ;; App sandbox extensions
    46 (allow file-read* file-write* (container-subpath "Library/")
    47        (extension "com.apple.app-sandbox.read-write"))
    48 
    49 ;; Access to own cache & temp folders.
    50 (allow file-read* file-write* (container-subpath "")
    51        (extension "com.apple.webkit.read-write"))
    52 
    53 ;; IOKit user clients
    54 (allow iokit-open
    55        (iokit-user-client-class "RootDomainUserClient"))
    56 
    57 ;; Various services required by CFNetwork and other frameworks
    58 (allow mach-lookup
    59        (global-name "com.apple.PowerManagement.control"))
    60 
    61 (network-client)
    62 
    63 ;; Security framework
    64 (allow mach-lookup
    65        (global-name "com.apple.ocspd")
    66        (global-name "com.apple.securityd"))
    67 
    68 (deny file-write-create
    69        (vnode-type SYMLINK))
  • trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp

    r170608 r170686  
    4343    encoder << diskCacheDirectory;
    4444    encoder << diskCacheDirectoryExtensionHandle;
    45     encoder << cookieStorageDirectory;
    46     encoder << cookieStorageDirectoryExtensionHandle;
    4745    encoder << shouldUseTestingNetworkSession;
    4846#if ENABLE(CUSTOM_PROTOCOLS)
    … …  
    7573        return false;
    7674    if (!decoder.decode(result.diskCacheDirectoryExtensionHandle))
    77         return false;
    78     if (!decoder.decode(result.cookieStorageDirectory))
    79         return false;
    80     if (!decoder.decode(result.cookieStorageDirectoryExtensionHandle))
    8175        return false;
    8276    if (!decoder.decode(result.shouldUseTestingNetworkSession))
  • trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h

    r170608 r170686  
    5757    SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
    5858
    59     String cookieStorageDirectory;
    60     SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
    61 
    6259    bool shouldUseTestingNetworkSession;
    6360
  • trunk/Source/WebKit2/Shared/mac/SandboxUtilities.cpp

    r170608 r170686  
    2828
    2929#include <array>
    30 #include <wtf/text/WTFString.h>
    3130
    3231#if __has_include(<sandbox/private.h>)
    … …  
    6968}
    7069
    71 String pathForProcessContainer()
    72 {
    73     std::array<char, MAXPATHLEN> path;
    74     path[0] = 0;
    75     sandbox_container_path_for_pid(getpid(), path.data(), path.size());
    76 
    77     return String::fromUTF8(path.data());
    7870}
    79 
    80 }
  • trunk/Source/WebKit2/Shared/mac/SandboxUtilities.h

    r170608 r170686  
    2828
    2929#include <sys/types.h>
    30 #include <wtf/Forward.h>
    3130
    3231namespace WebKit {
    … …  
    3534bool processHasContainer();
    3635
    37 // Returns an empty string if the process is not in a container.
    38 String pathForProcessContainer();
    39 
    4036}
    4137
  • trunk/Source/WebKit2/UIProcess/WebContext.cpp

    r170608 r170686  
    412412        SandboxExtension::createHandleForReadWriteDirectory(parameters.diskCacheDirectory, parameters.diskCacheDirectoryExtensionHandle);
    413413
    414     parameters.cookieStorageDirectory = cookieStorageDirectory();
    415     if (!parameters.cookieStorageDirectory.isEmpty())
    416         SandboxExtension::createHandleForReadWriteDirectory(parameters.cookieStorageDirectory, parameters.cookieStorageDirectoryExtensionHandle);
    417 
    418414    parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession;
    419415
  • trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm

    r170608 r170686  
    2828
    2929#import "PluginProcessManager.h"
    30 #import "SandboxUtilities.h"
    3130#import "TextChecker.h"
    3231#import "WKBrowsingContextControllerInternal.h"
    … …  
    271270String WebContext::platformDefaultCookieStorageDirectory() const
    272271{
    273 #if PLATFORM(IOS)
    274     String path = pathForProcessContainer();
    275     if (path.isEmpty())
    276         path = NSHomeDirectory();
    277 
    278     path = path + "/Library/Cookies";
    279     return stringByResolvingSymlinksInPath(path);
    280 #else
    281272    notImplemented();
    282273    return [@"" stringByStandardizingPath];
    283 #endif
    284274}
    285275
  • trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm

    r170608 r170686  
    168168    SandboxExtension::consumePermanently(parameters.applicationCacheDirectoryExtensionHandle);
    169169    SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
    170     SandboxExtension::consumePermanently(parameters.cookieStorageDirectoryExtensionHandle);
    171170#endif
    172171
Note: See TracChangeset for help on using the changeset viewer.