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

Changeset 275057 in webkit


Ignore:
Timestamp:
Mar 25, 2021, 2:23:45 PM (5 years ago)
Author:
pvollan@apple.com
Message:

Enforce notifyd message filtering
https://bugs.webkit.org/show_bug.cgi?id=223601
<rdar://75098580>

Reviewed by Brent Fulgham.

Source/WebCore/PAL:

Add Notify SPI file.

  • PAL.xcodeproj/project.pbxproj:
  • pal/spi/cocoa/NotifySPI.h: Added.

Source/WebKit:

Enable Notify filtering by setting Notify options before entering sandbox.

  • Shared/mac/AuxiliaryProcessMac.mm:

(WebKit::compileAndApplySandboxSlowCase):

Source/WTF:

Add ENABLE define for Notify filtering.

  • wtf/PlatformEnableCocoa.h:
Location:
trunk/Source
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r275053 r275057  
     12021-03-25  Per Arne  <pvollan@apple.com>
     2
     3        Enforce notifyd message filtering
     4        https://bugs.webkit.org/show_bug.cgi?id=223601
     5        <rdar://75098580>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add ENABLE define for Notify filtering.
     10
     11        * wtf/PlatformEnableCocoa.h:
     12
    1132021-03-25  Don Olmstead  <don.olmstead@sony.com>
    214
  • trunk/Source/WTF/wtf/PlatformEnableCocoa.h

    r274983 r275057  
    662662#define ENABLE_SEPARATED_MODEL 1
    663663#endif
     664
     665#if !defined(ENABLE_NOTIFY_FILTERING) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
     666#define ENABLE_NOTIFY_FILTERING 1
     667#endif
  • trunk/Source/WebCore/PAL/ChangeLog

    r274734 r275057  
     12021-03-25  Per Arne  <pvollan@apple.com>
     2
     3        Enforce notifyd message filtering
     4        https://bugs.webkit.org/show_bug.cgi?id=223601
     5        <rdar://75098580>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add Notify SPI file.
     10
     11        * PAL.xcodeproj/project.pbxproj:
     12        * pal/spi/cocoa/NotifySPI.h: Added.
     13
    1142021-03-19  Jer Noble  <jer.noble@apple.com>
    215
  • trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

    r273895 r275057  
    199199                CDF91113220E4EEC001EA39E /* CelestialSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF91112220E4EEC001EA39E /* CelestialSPI.h */; };
    200200                CE5673872151A7B9002F92D7 /* IOKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE5673862151A7B9002F92D7 /* IOKitSPI.h */; };
     201                E327C0DF260BE436002281C5 /* NotifySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = E327C0DE260BDC90002281C5 /* NotifySPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
    201202                E5D45D122106A07400D2B738 /* NSColorWellSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D45D112106A07400D2B738 /* NSColorWellSPI.h */; };
    202203                E5D45D142106A18700D2B738 /* NSPopoverColorWellSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = E5D45D132106A18700D2B738 /* NSPopoverColorWellSPI.h */; };
     
    411412                CDF91112220E4EEC001EA39E /* CelestialSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CelestialSPI.h; sourceTree = "<group>"; };
    412413                CE5673862151A7B9002F92D7 /* IOKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOKitSPI.h; sourceTree = "<group>"; };
     414                E327C0DE260BDC90002281C5 /* NotifySPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotifySPI.h; sourceTree = "<group>"; };
    413415                E5D45D112106A07400D2B738 /* NSColorWellSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorWellSPI.h; sourceTree = "<group>"; };
    414416                E5D45D132106A18700D2B738 /* NSPopoverColorWellSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSPopoverColorWellSPI.h; sourceTree = "<group>"; };
     
    511513                                1CC3ACE722BD7EB800F360F0 /* MetalSPI.h */,
    512514                                0C2DA12D1F3BEB4900DBC317 /* NEFilterSourceSPI.h */,
     515                                E327C0DE260BDC90002281C5 /* NotifySPI.h */,
    513516                                0C7785741F45130F00F4EBB6 /* NSAccessibilitySPI.h */,
    514517                                0C2DA12E1F3BEB4900DBC317 /* NSAttributedStringSPI.h */,
     
    879882                                0C5AF91E1F43A4C7002EAC02 /* MobileGestaltSPI.h in Headers */,
    880883                                0C2DA1491F3BEB4900DBC317 /* NEFilterSourceSPI.h in Headers */,
     884                                E327C0DF260BE436002281C5 /* NotifySPI.h in Headers */,
    881885                                0C77858D1F45130F00F4EBB6 /* NSAccessibilitySPI.h in Headers */,
    882886                                1CCEE4F720D8743F0047B097 /* NSAppearanceSPI.h in Headers */,
  • trunk/Source/WebKit/ChangeLog

    r275054 r275057  
     12021-03-25  Per Arne  <pvollan@apple.com>
     2
     3        Enforce notifyd message filtering
     4        https://bugs.webkit.org/show_bug.cgi?id=223601
     5        <rdar://75098580>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Enable Notify filtering by setting Notify options before entering sandbox.
     10
     11        * Shared/mac/AuxiliaryProcessMac.mm:
     12        (WebKit::compileAndApplySandboxSlowCase):
     13
    1142021-03-25  Aditya Keerthi  <akeerthi@apple.com>
    215
  • trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm

    r275013 r275057  
    4444#import <pal/spi/cocoa/CoreServicesSPI.h>
    4545#import <pal/spi/cocoa/LaunchServicesSPI.h>
     46#import <pal/spi/cocoa/NotifySPI.h>
    4647#import <pwd.h>
    4748#import <stdlib.h>
     
    6667SOFT_LINK_SYSTEM_LIBRARY(libsystem_info)
    6768SOFT_LINK_OPTIONAL(libsystem_info, mbr_close_connections, int, (), ());
     69
     70#if ENABLE(NOTIFY_FILTERING)
     71SOFT_LINK_SYSTEM_LIBRARY(libsystem_notify)
     72SOFT_LINK_OPTIONAL(libsystem_notify, notify_set_options, void, __cdecl, (uint32_t));
     73#endif
    6874
    6975#if PLATFORM(MAC)
     
    443449}
    444450
     451static void setNotifyOptions()
     452{
     453#if ENABLE(NOTIFY_FILTERING)
     454    if (notify_set_optionsPtr())
     455        notify_set_optionsPtr()(NOTIFY_OPT_DISPATCH | NOTIFY_OPT_REGEN | NOTIFY_OPT_FILTERED);
     456#endif
     457}
     458
    445459static bool tryApplyCachedSandbox(const SandboxInfo& info)
    446460{
     
    506520    ASSERT(static_cast<void *>(sandboxDataPtr + profile.size) <= static_cast<void *>(cachedSandboxContents.data() + cachedSandboxContents.size()));
    507521    profile.data = sandboxDataPtr;
     522
     523    setNotifyOptions();
    508524
    509525    if (sandbox_apply(&profile)) {
     
    545561    CString temp = isProfilePath ? FileSystem::fileSystemRepresentation(profileOrProfilePath) : profileOrProfilePath.utf8();
    546562    uint64_t flags = isProfilePath ? SANDBOX_NAMED_EXTERNAL : 0;
     563
     564    setNotifyOptions();
     565
    547566    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    548567    if (sandbox_init_with_parameters(temp.data(), flags, parameters.namedParameterArray(), &errorBuf)) {
     
    604623        return compileAndApplySandboxSlowCase(profileOrProfilePath, isProfilePath, sandboxInitializationParameters);
    605624
     625    setNotifyOptions();
     626   
    606627    if (sandbox_apply(sandboxProfile.get())) {
    607628        WTFLogAlways("%s: Could not apply compiled sandbox: %s\n", getprogname(), strerror(errno));
Note: See TracChangeset for help on using the changeset viewer.