AX: web process should load correct bundle path for MACCATALYST
[WebKit.git] / Source / WebKit / WebProcess / com.apple.WebProcess.sb.in
1 ; Copyright (C) 2010-2019 Apple Inc. All rights reserved.
2 ;
3 ; Redistribution and use in source and binary forms, with or without
4 ; modification, are permitted provided that the following conditions
5 ; are met:
6 ; 1. Redistributions of source code must retain the above copyright
7 ;    notice, this list of conditions and the following disclaimer.
8 ; 2. Redistributions in binary form must reproduce the above copyright
9 ;    notice, this list of conditions and the following disclaimer in the
10 ;    documentation and/or other materials provided with the distribution.
11 ;
12 ; THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
13 ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
14 ; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 ; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
16 ; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17 ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18 ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19 ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20 ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21 ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
22 ; THE POSSIBILITY OF SUCH DAMAGE.
23
24 (version 1)
25 (deny default (with partial-symbolication))
26 (allow system-audit file-read-metadata)
27
28 ;;;
29 ;;; The following rules were originally contained in 'system.sb'. We are duplicating them here so we can
30 ;;; remove unneeded sandbox extensions.
31 ;;;
32
33 ;;; Allow registration of per-pid services.
34 (allow mach-register (local-name-prefix ""))
35
36 ;;; Allow read access to standard system paths.
37 (allow file-read*
38     (require-all (file-mode #o0004)
39     (require-any (subpath "/Library/Filesystems/NetFSPlugins")
40     (subpath "/Library/Apple/System")
41     (subpath "/Library/Preferences/Logging")      ; Logging Rethink
42     (subpath "/System")
43     (subpath "/private/var/db/dyld")
44     (subpath "/private/var/db/timezone")
45     (subpath "/usr/lib")
46     (subpath "/usr/share"))))
47
48 ;;; Allow reading internal profiles on development builds
49 (allow file-read*
50     (require-all (file-mode #o0004)
51     (subpath "/AppleInternal/Library/Preferences/Logging")
52     (system-attribute apple-internal)))
53
54 ;;; Allow mapping of system frameworks + dylibs
55 (allow file-map-executable
56     (subpath "/Library/Apple/System/Library/Frameworks")
57     (subpath "/Library/Apple/System/Library/PrivateFrameworks")
58     (subpath "/System/Library/Frameworks")
59     (subpath "/System/Library/PrivateFrameworks")
60     (subpath "/usr/lib")
61     (literal "/usr/local/lib/sanitizers"))
62
63 (allow file-read-metadata
64     (literal "/etc")
65     (literal "/tmp")
66     (literal "/var")
67     (literal "/private/etc/localtime"))
68
69
70 ;;; Allow access to standard special files.
71 (allow file-read*
72     (literal "/dev/autofs_nowait")
73     (literal "/dev/random")
74     (literal "/dev/urandom")
75     (literal "/private/etc/master.passwd")
76     (literal "/private/etc/passwd"))
77
78 (allow file-read*
79        file-write-data
80     (literal "/dev/null")
81     (literal "/dev/zero"))
82
83 (allow file-read*
84        file-write-data
85        file-ioctl
86     (literal "/dev/dtracehelper"))
87
88 ;;; Allow creation of core dumps.
89 (allow file-write-create
90     (require-all (prefix "/cores/")
91         (vnode-type REGULAR-FILE)))
92
93 ;;; Allow IPC to standard system agents.
94 (allow ipc-posix-shm-read*
95     (ipc-posix-name "apple.shm.notification_center")
96     (ipc-posix-name-prefix "apple.cfprefs."))
97
98 ;;; (system-graphics) - Allow access to graphics hardware.
99 (define (system-graphics)
100     ;; Preferences
101     (allow user-preference-read
102         (preference-domain "com.apple.opengl")
103         (preference-domain "com.nvidia.OpenGL"))
104     ;; CVMS
105     (allow mach-lookup
106         (global-name "com.apple.cvmsServ"))
107 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
108     (allow file-read*
109         (prefix "/private/var/db/CVMS/cvmsCodeSignObj"))
110 #endif
111     ;; OpenCL
112     (allow iokit-open
113         (iokit-connection "IOAccelerator")
114         (iokit-registry-entry-class "IOAccelerationUserClient")
115         (iokit-registry-entry-class "IOSurfaceRootUserClient")
116         (iokit-registry-entry-class "IOSurfaceSendRight"))
117     ;; CoreVideo CVCGDisplayLink
118     (allow iokit-open
119         (iokit-registry-entry-class "IOFramebufferSharedUserClient"))
120     ;; H.264 Acceleration
121     (allow iokit-open
122         (iokit-registry-entry-class "AppleIntelMEUserClient")
123         (iokit-registry-entry-class "AppleSNBFBUserClient"))
124     ;; QuartzCore
125     (allow iokit-open
126         (iokit-registry-entry-class "AGPMClient")
127         (iokit-registry-entry-class "AppleGraphicsControlClient")
128         (iokit-registry-entry-class "AppleGraphicsPolicyClient"))
129     ;; OpenGL
130     (allow iokit-open
131         (iokit-registry-entry-class "AppleMGPUPowerControlClient"))
132     ;; GPU bundles
133     (allow file-read*
134         (subpath "/Library/GPUBundles"))
135     ;; DisplayServices
136     (allow iokit-set-properties
137         (require-all (iokit-connection "IODisplay")
138         (require-any (iokit-property "brightness")
139         (iokit-property "linear-brightness")
140         (iokit-property "commit")
141         (iokit-property "rgcs")
142         (iokit-property "ggcs")
143         (iokit-property "bgcs")))))
144
145 ;;;
146 ;;; End rules originally copied from 'system.sb'
147 ;;;
148
149 ;;; process-info* defaults to allow; deny it and then allow operations we actually need.
150 (deny process-info*)
151 (allow process-info-pidinfo)
152 (allow process-info-setcontrol (target self))
153 (allow process-codesigning-status*)
154
155 (deny sysctl*)
156 (allow sysctl-read
157     (sysctl-name
158         "hw.byteorder"
159         "hw.busfrequency_max"
160         "hw.cputype"
161         "hw.machine"
162         "hw.memsize"
163         "hw.model"
164         "hw.ncpu"
165         "hw.vectorunit"
166         "kern.bootargs" ;; <rdar://problem/47738015>
167         "kern.hostname"
168         "kern.maxfilesperproc"
169         "kern.memorystatus_level"
170         "kern.osproductversion" ;; <rdar://problem/51756739>
171         "kern.safeboot"
172         "kern.version"
173         "machdep.cpu.brand_string"
174         "security.mac.sandbox.sentinel"
175         "kern.tcsm_enable"
176         "kern.tcsm_available"
177         "vm.footprint_suspend")
178     (sysctl-name-regex #"^hw.(active|avail)cpu")
179     (sysctl-name-regex #"^hw.(busfrequency|cachelinesize|cpufrequency(|_max)|pagesize|tbfrequency)(|_compat)")
180     (sysctl-name-regex #"^hw.l.+cachesize")
181     (sysctl-name-regex #"^hw.(logical|physical)cpu_max")
182     (sysctl-name-regex #"^hw.optional\.")
183     (sysctl-name-regex #"^kern.os(release|type|variant_status|version)")
184     (sysctl-name-regex #"^net.routetable")
185 )
186
187 (allow sysctl-write
188     (sysctl-name
189         "kern.tcsm_enable"))
190
191 (deny iokit-get-properties)
192 (allow iokit-get-properties
193     (iokit-property "AAPL,LCD-PowerState-ON") ;; <rdar://problem/47738015>
194     (iokit-property "AGCInfo")
195     (iokit-property-regex #"^Accel(Caps|NativeDMARowByteAlignment)")
196     (iokit-property-regex #"^(Accurate|Extended)MaxDigitizerPressureValue")
197     (iokit-property-regex #"^(Activation|Animation)Thresholds")
198     (iokit-property "ActuationSupported")
199     (iokit-property "AllowDisplaySleep")
200     (iokit-property "AlwaysNeedsVelocityCalculated")
201     (iokit-property-regex #"Apple(GVAKeyDoesNotExist|IntelMEVABundleName)")
202     (iokit-property-regex #"^AAPL,(DisplayPipe|OpenCLdisabled|IOGraphics_LER(|_RegTag_1|_RegTag_0|_Busy_2)|alias-policy|boot-display|display-alias|mux-switch-state|ndrv-dev|primary-display|slot-name)")
203     (iokit-property-regex #"^ATY,(cbits|fb_(linebytes|offset|size)|intrev)")
204     (iokit-property "ATY,DeviceName") ;; Needed by Metal compilers
205     (iokit-property "ATY,FamilyName") ;; Ditto
206     (iokit-property "AVCSupported")
207     (iokit-property "BacklightHandle")
208     (iokit-property "BlockSize")
209     (iokit-property-regex #"^CEA(ModeID|PixelRepetition)")
210     (iokit-property "CFBundleIdentifier")
211     (iokit-property "CFBundleIdentifierKernel") ;; <rdar://problem/47738015>
212     (iokit-property "CapsLockDelay")
213     (iokit-property "CaseSensitive")
214     (iokit-property "ConfigState")
215     (iokit-property "Description")
216     (iokit-property "Development")
217     (iokit-property-regex #"^Device( Characteristics|EqID)")
218     (iokit-property "DisplayRouting")
219     (iokit-property "Driver is Ready")
220     (iokit-property "Ejectable")
221     (iokit-property "EnableLPVP")
222     (iokit-property "Encrypted")
223     (iokit-property "Endianness")
224     (iokit-property "Family ID")
225     (iokit-property "ForceSupported")
226     (iokit-property "Formats")
227     (iokit-property "GPUConfigurationVariable")
228     (iokit-property "GpuDebugPolicy")
229     (iokit-property "HEVCSupported")
230     (iokit-property "HIDPointerAccelerationType")
231     (iokit-property-regex #"^IOAccel(DisplayPipeCapabilities|Index|Types|Revision)")
232     (iokit-property-regex #"^IO(Class|MatchCategory|NameMatch)")
233     (iokit-property-regex #"^IOAudioControl(ChannelID|ID|SubType|Usage|Value)")
234     (iokit-property-regex #"^IOAudioDevice(CanBeDefaults|TransportType)")
235     (iokit-property-regex #"^IOAudioEngine(ChannelNames|ClientDescription|CoreAudioPlugIn|(|Device)Description|Flavor|GlobalUniqueID|IsHidden|OutputChannelLayout|SampleOffset|State)")
236     (iokit-property-regex #"^IOAudioEngineClock(Domain|IsStable)")
237     (iokit-property "IOAudioEngineDisableClockBoundsCheck")
238     (iokit-property-regex #"^IOAudioEngine(Input|Output)Sample(Latency|Offset)")
239     (iokit-property-regex #"^IOAudioEngineNum(ActiveUserClients|SampleFramesPerBuffer)")
240     (iokit-property "IOAudioSampleRate")
241     (iokit-property "IOAudioStreamSampleFormatByteOrder")
242     (iokit-property-regex #"^IOAV(.*)(De|En)code$")
243     (iokit-property "IOBacklightHandlerID")
244     (iokit-property "IOBusyInterest")
245     (iokit-property "IOCFPlugInTypes")
246     (iokit-property "IOChildIndex")
247     (iokit-property-regex #"^IOClass(|NameOverride)")
248     (iokit-property "IOConsoleUsers")
249     (iokit-property "IODVDBundleName")
250     (iokit-property "IODeviceMemory")
251     (iokit-property "IODisplayParameters")
252     (iokit-property-regex #"^IOFB(CLUTDefer|Config|CursorInfo|Dependent(ID|Index))")
253     (iokit-property "IOFBCurrentPixelClock")
254     (iokit-property-regex #"^IOFBCurrentPixelCount(|Real)")
255     (iokit-property-regex #"^IOFB(DetailedTimings|Gamma(Count|HeaderSize|Width))")
256     (iokit-property-regex #"^IOFB(Blue|Green|Red)GammaScale")
257     (iokit-property-regex #"^IOFBI2CInterface(IDs|Info)")
258     (iokit-property-regex #"^IOFB(HDMIDongleROM|Integrated|MemorySize|NeedsRefresh|ProbeOptions|ScalerInfo|TimingRange|Transform|UIScale|WaitCursor(Frames|Period))")
259     (iokit-property "IOFramebufferOpenGLIndex")
260     (iokit-property "IOGeneralInterest")
261     (iokit-property "IOGLBundleName")
262     (iokit-property-regex #"^IOGVA(BGRAEnc|Codec|EncoderRestricted|Scaler|VTCapabilities|HEVCDecodeCapabilities|HEVCEncodeCapabilities)")
263     (iokit-property-regex #"^IOGVA(.*)(De|En)code$")
264     (iokit-property "IOHibernateState")
265     (iokit-property "IOI2CTransactionTypes")
266     (iokit-property-regex #"^IOInterrupt(Controllers|Specifiers)")
267     (iokit-property "IOKitDebug")
268     (iokit-property "IOMatchCategory")
269     (iokit-property "IOMediaIcon")
270     (iokit-property "IONDRVFramebufferGeneration")
271     (iokit-property "IONVRAMProperty")
272     (iokit-property-regex #"^IOName(|Match(|ed))")
273     (iokit-property "IOOCDBundleName")
274     (iokit-property "IOPCITunnelled")
275     (iokit-property "IOPCITunnelCompatible")
276     (iokit-property "IOPMStrictTreeOrder")
277     (iokit-property "IOParentMatch")
278     (iokit-property-regex #"^IOPCI((Class|Primary|Property|)Match|Express(Capabilities|Link(Status|Capabilities))|MSIMode|Resourced|Tunnelled)")
279     (iokit-property "IOPMIsPowerManaged")
280     (iokit-property-regex #"^IOPlatform(SerialNumber|UUID)")
281     (iokit-property "IOPowerManagement")
282     (iokit-property "IOProbeScore")
283     (iokit-property "IOPropertyMatch")
284     (iokit-property "IOProviderClass")
285     (iokit-property-regex #"^IOReport(Lures|Legend(|Public))")
286     (iokit-property "IOScreenRestoreState")
287     (iokit-property "IOSourceVersion")
288     (iokit-property-regex #"^IOVA(BundleName|Renderer(|Sub)ID)")
289     (iokit-property-regex #"^InternalStatistics(|Accm)")
290     (iokit-property-regex #"^MetalPlugin(Name|ClassName)")
291     (iokit-property "MetalStatisticsName")
292     (iokit-property "MTHIDDevice")
293     (iokit-property "MT Built-In")
294     (iokit-property "MaintainPowerInUILock")
295     (iokit-property "Max Packet Size")
296     (iokit-property "MinDigitizerPressureValue")
297     (iokit-property "Multitouch Serial Number")
298     (iokit-property-regex #"^Multitouch (Subdevice |)ID")
299     (iokit-property "NVArch")
300     (iokit-property-regex #"^NVC(AP|LASS)")
301     (iokit-property-regex #"^NVDA,(Features|NVPresentment-version|accel-loaded|invalid-config|mm-version)")
302     (iokit-property "NVDA,Enable-A2R10G10B10Format")
303     (iokit-property-regex #"^NVDA(Type|initgl_created)")
304     (iokit-property "NVRAMProperty")
305     (iokit-property "NXSystemInfo")
306     (iokit-property-regex #"^VRAM,(memvendorID|total(MB|size))")
307     (iokit-property "NoAutoRoute")
308     (iokit-property-regex #"^Num(Blocks|Streams)")
309     (iokit-property-regex #"^PerformanceStatistics(|Accum)")
310     (iokit-property "Protocol Characteristics")
311     (iokit-property "Removable")
312     (iokit-property-regex #"^ResetOn(Lock|Unlock)Ms")
313     (iokit-property "SafeEjectRequested")
314     (iokit-property "SampleRates")
315     (iokit-property "Serial Number")
316     (iokit-property "StartupDisplay")
317     (iokit-property "SurfaceList")
318     (iokit-property-regex #"^Support(AudioAUUC|sSilentClick|TapToWake)")
319     (iokit-property-regex #"^Sensor (Columns|Rows)")
320     (iokit-property-regex #"^Sensor Region (Descriptor|Param|Rows)")
321     (iokit-property-regex #"^Sensor Surface (Descriptor|Height|Width)")
322     (iokit-property "SurfaceList")
323     (iokit-property "TimeStampFiltering")
324     (iokit-property "Transport")
325     (iokit-property "USBADC") ;; Needed for Audio support on older hardware
326     (iokit-property "UserClientEnabled")
327     (iokit-property "VRAM,totalMB")
328     (iokit-property "WANTS_FRAMES_IGNORED")
329     (iokit-property-regex #"^acpi-(device|path)")
330     (iokit-property "assigned-addresses")
331     (iokit-property "attached-gpu-control-path")
332     (iokit-property-regex #"^audio-(codec-info|device-mvalue|device-nvalue|selector)")
333     (iokit-property "av-signal-type")
334     (iokit-property "bcdVersion")
335     (iokit-property-regex #"^(board|device|revision|subsystem|vendor)-id")
336     (iokit-property "boot-gamma-restored")
337     (iokit-property "built-in")
338     (iokit-property "cail_properties")
339     (iokit-property-regex #"^canvas-(height|width)")
340     (iokit-property "class-code")
341     (iokit-property "color-accuracy-index")
342     (iokit-property "compatible")
343     (iokit-property "connector-type")
344     (iokit-property-regex #"^(device|revision|subsystem-vendor|touch-size)-id")
345     (iokit-property "device_type")
346     (iokit-property "dpm")
347     (iokit-property "errordb") ;; Needed for OpenGL on older hardware
348     (iokit-property "filevault-image") ;; Needed by LaunchServices
349     (iokit-property "graphic-options")
350     (iokit-property "hda-gfx")
351     (iokit-property-regex #"^id(Product|Vendor)")
352     (iokit-property "iofb_version")
353     (iokit-property "image-encrypted")
354     (iokit-property "image-path") ;; Needed by LaunchServices
355     (iokit-property "locationID") ;; Needed for Audio support on older hardware
356     (iokit-property "model")
357     (iokit-property "mt-device-id")
358     (iokit-property "name")
359     (iokit-property "nv-stats")
360     (iokit-property "od-server-name") ;; Needed by LaunchServices
361     (iokit-property-regex #"^parser-(options|type)")
362     (iokit-property-regex #"^pci(-aspm-default|debug)")
363     (iokit-property "port-number")
364     (iokit-property "reg")
365     (iokit-property "rm_board_number")
366     (iokit-property-regex #"^(rom|vbios)-revision")
367     (iokit-property "saved-config")
368     (iokit-property "startup-timing")
369     (iokit-property "touch-size-id")
370 #if !PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
371     (iokit-property "ATY,cbits")
372     (iokit-property "ATY,intrev")
373     (iokit-property "AccelNativeDMARowByteAlignment")
374     (iokit-property "CompactVRAM")
375     (iokit-property "EnableBlitLib")
376     (iokit-property "ForceDisableEDRAM")
377     (iokit-property "GPUConfigurationVariable")
378     (iokit-property "GpuDebugPolicy")
379     (iokit-property "IOKitDebug")
380     (iokit-property "IOPCIMatch")
381     (iokit-property "IOOCDBundleName")
382     (iokit-property "MetalStatisticsScriptName")
383     (iokit-property "MetalCoalesce")
384     (iokit-property "PanicOnGPUHang")
385     (iokit-property "TelemetryDisable")
386     (iokit-property "cail_properties")
387     (iokit-property "dpm")
388 #endif
389     (iokit-property "IOGVAH264EncodeCapabilities") ;; <rdar://problem/49498040>
390 )
391
392 (deny mach-lookup (xpc-service-name-prefix ""))
393 (allow mach-lookup
394     (xpc-service-name "com.apple.PerformanceAnalysis.animationperfd")
395     (xpc-service-name "com.apple.accessibility.mediaaccessibilityd")
396     (xpc-service-name "com.apple.audio.SandboxHelper")
397     (xpc-service-name "com.apple.coremedia.videodecoder")
398     (xpc-service-name "com.apple.coremedia.videoencoder")
399     (xpc-service-name-regex #"\.apple-extension-service$")
400     (xpc-service-name "com.apple.hiservices-xpcservice")
401     (xpc-service-name "com.apple.print.normalizerd")
402 )
403
404 ;; Utility functions for home directory relative path filters
405 (define (home-regex home-relative-regex)
406   (regex (string-append "^" (regex-quote (param "HOME_DIR")) home-relative-regex)))
407
408 (define (home-subpath home-relative-subpath)
409   (subpath (string-append (param "HOME_DIR") home-relative-subpath)))
410
411 (define (home-literal home-relative-literal)
412   (literal (string-append (param "HOME_DIR") home-relative-literal)))
413
414 (define (allow-read-directory-and-issue-read-extensions path)
415     (if path
416         (begin
417             (allow file-read* (subpath path))
418             (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read") (subpath path))))))
419
420 (define (allow-read-write-directory-and-issue-read-write-extensions path)
421     (if path
422         (begin
423             (allow file-read* file-write* (subpath path))
424             (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read") (subpath path)))
425             (allow file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read-write") (subpath path))))))
426
427 ;; Remove when <rdar://problem/29646094> is fixed.
428 (define (HEX-pattern-match-generator pattern-descriptor)
429     (letrec ((pattern-string ""))
430         (for-each  (lambda (repeat-count)
431             (if (zero? repeat-count)
432                 (set! pattern-string (string-append  pattern-string "-"))
433                 (let appender ((count repeat-count))
434                     (if (> count 0)
435                         (begin
436                             (set! pattern-string (string-append  pattern-string "[0-9A-F]"))
437                             (appender (- count 1)))))))
438             pattern-descriptor)
439     pattern-string))
440
441 ;; return a regex pattern matching string for 8-4-4-4-12 UUIDs:
442 (define (uuid-HEX-pattern-match-string)
443     (HEX-pattern-match-generator '(8 0 4 0 4 0 4 0 12)))
444
445 ;; global to hold the computed UUID matching pattern.
446 (define *uuid-pattern* "")
447
448 (define (uuid-regex-string)
449     (if (zero? (string-length *uuid-pattern*))
450         (set! *uuid-pattern* (uuid-HEX-pattern-match-string)))
451     *uuid-pattern*)
452
453 ;; Read-only preferences and data
454 (allow file-read*
455     ;; Basic system paths
456     (subpath "/Library/Dictionaries")
457     (subpath "/Library/Fonts")
458     (subpath "/Library/Frameworks")
459     (subpath "/Library/Managed Preferences")
460     (subpath "/Library/Speech/Synthesizers")
461     (regex #"^/private/etc/(hosts|group|passwd)$")
462
463     (literal "/Library/Application Support/CrashReporter/SubmitDiagInfo.domains")
464
465     ;; System and user preferences
466     (home-literal "/.CFUserTextEncoding")
467
468     ;; FIXME: This should be removed when <rdar://problem/8957845> is fixed.
469     (home-subpath "/Library/Fonts")
470
471     (subpath "/Library/Audio/Plug-Ins/HAL")
472
473     (home-subpath "/Library/Dictionaries"))
474
475 (allow file-read-data
476     (literal "/usr/local/lib/log") ; <rdar://problem/36629495>
477     ;; Needed for AES3 support
478     (subpath "/Library/Audio/Plug-Ins/Components"))
479
480 ;; Preferences support
481 (allow user-preference-read
482     (preference-domain
483         "kCFPreferencesAnyApplication"
484         "com.apple.Accessibility"
485         "com.apple.ATS"
486         "com.apple.CoreGraphics"
487         "com.apple.DownloadAssessment"
488         "com.apple.HIToolbox"
489         "com.apple.LaunchServices"
490         "com.apple.MultitouchSupport" ;; FIXME: Remove when <rdar://problem/13011633> is fixed.
491         "com.apple.ServicesMenu.Services" ;; Needed for NSAttributedString <rdar://problem/10844321>
492         "com.apple.ViewBridge" ;; Needed for Input elements.
493         "com.apple.WebFoundation"
494         "com.apple.avfoundation"
495         "com.apple.avfoundation.frecents" ;; <rdar://problem/33137029>
496         "com.apple.avfoundation.videoperformancehud" ;; <rdar://problem/31594568>
497         "com.apple.coremedia"
498         "com.apple.crypto"
499         "com.apple.driver.AppleBluetoothMultitouch.mouse"
500         "com.apple.driver.AppleBluetoothMultitouch.trackpad"
501         "com.apple.driver.AppleHIDMouse"
502         "com.apple.lookup.shared"
503         "com.apple.mediaaccessibility" ;; Needed for custom caption styles
504         "com.apple.networkConnect"
505         "com.apple.speech.voice.prefs"
506         "com.apple.systemsound"
507         "com.apple.universalaccess"
508         "edu.mit.Kerberos"
509         "pbs" ;; Needed for NSAttributedString <rdar://problem/10844321>
510 ))
511
512 ; (Temporary) backward compatibility with non-CFPreferences readers.
513 (allow file-read*
514     (literal "/Library/Preferences/com.apple.ViewBridge.plist"))
515
516 ; FIXME: This is needed for some security framework calls (that use non-CFPreferences readers)
517 (allow file-read-data
518     (literal "/Library/Preferences/com.apple.security.plist")
519     (home-subpath "/Library/Preferences/com.apple.security.plist"))
520
521 ;; On-disk WebKit2 framework location, to account for debug installations outside of /System/Library/Frameworks,
522 ;; and to allow issuing extensions.
523 (allow-read-directory-and-issue-read-extensions (param "WEBKIT2_FRAMEWORK_DIR"))
524
525 ;; Allow issuing extensions to system libraries that the Network process can already read.
526 ;; This is to avoid warnings attempting to create extensions for these resources.
527 (allow-read-directory-and-issue-read-extensions "/System/Library/PrivateFrameworks/WebInspectorUI.framework")
528
529 ;; Sandbox extensions
530 (define (apply-read-and-issue-extension op path-filter)
531     (op file-read* path-filter)
532     (op file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read") path-filter)))
533 (define (apply-write-and-issue-extension op path-filter)
534     (op file-write* path-filter)
535     (op file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read-write") path-filter)))
536 (define (read-only-and-issue-extensions path-filter)
537     (apply-read-and-issue-extension allow path-filter))
538 (define (read-write-and-issue-extensions path-filter)
539     (apply-read-and-issue-extension allow path-filter)
540     (apply-write-and-issue-extension allow path-filter))
541 (read-only-and-issue-extensions (extension "com.apple.app-sandbox.read"))
542 (read-write-and-issue-extensions (extension "com.apple.app-sandbox.read-write"))
543 (allow mach-lookup (extension "com.apple.app-sandbox.mach")) ;; FIXME: Should be removed when <rdar://problem/13066206> is fixed.
544
545 ;; Allow the OpenGL Profiler to attach.
546 (if (defined? 'mach-register)
547     (allow mach-register (global-name-regex #"^_oglprof_attach_<[0-9]+>$")))
548
549 (if (positive? (string-length (param "DARWIN_USER_CACHE_DIR")))
550     (allow-read-write-directory-and-issue-read-write-extensions (param "DARWIN_USER_CACHE_DIR")))
551
552 (if (positive? (string-length (param "DARWIN_USER_TEMP_DIR")))
553     (allow-read-write-directory-and-issue-read-write-extensions (param "DARWIN_USER_TEMP_DIR")))
554
555 ;; IOKit user clients
556 (allow iokit-open
557     (iokit-user-client-class "AppleMultitouchDeviceUserClient")
558     (iokit-user-client-class "AppleUpstreamUserClient")
559     (iokit-user-client-class "IOHIDParamUserClient")
560     (iokit-user-client-class "RootDomainUserClient")
561     (iokit-user-client-class "IOAudioControlUserClient")
562     (iokit-user-client-class "IOAudioEngineUserClient")
563     ;; Following is needed due to <rdar://problem/10427451> && <rdar://problem/10808817>
564     (iokit-user-client-class "AudioAUUC"))
565
566 ;; cookied.
567 ;; FIXME: Update for <rdar://problem/13642852>.
568 (allow ipc-posix-shm-read-data
569     (ipc-posix-name "FNetwork.defaultStorageSession")
570     (ipc-posix-name-regex #"\.PrivateBrowsing-")
571     (ipc-posix-name-regex #"^WebKit Test-"))
572
573 ;; ColorSync
574 (allow ipc-posix-shm*
575     (ipc-posix-name "com.apple.ColorSync.Gen.lock")
576     (ipc-posix-name "com.apple.ColorSync.Disp.lock")
577     (ipc-posix-name "com.apple.ColorSync.Gray2.2")
578     (ipc-posix-name "com.apple.ColorSync.sRGB")
579     (ipc-posix-name "com.apple.ColorSync.GenGray")
580     (ipc-posix-name "com.apple.ColorSync.GenRGB"))
581
582 ;; Audio
583 (allow ipc-posix-shm-read* ipc-posix-shm-write-data
584     (ipc-posix-name-regex #"^AudioIO"))
585
586 ;; Remote Web Inspector
587 (allow mach-lookup
588        (global-name "com.apple.webinspector"))
589
590 (allow mach-lookup
591     (global-name "com.apple.FileCoordination"))
592
593 ;; Various services required by AppKit and other frameworks
594 (allow mach-lookup
595 #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
596        (global-name "com.apple.FontObjectsServer")
597 #endif
598        (global-name "com.apple.PowerManagement.control")
599        (global-name "com.apple.SystemConfiguration.configd")
600        (global-name "com.apple.analyticsd")
601        (global-name "com.apple.audio.AudioComponentRegistrar")
602        (global-name "com.apple.assertiond.processassertionconnection")
603        (global-name "com.apple.audio.SystemSoundServer-OSX")
604        (global-name "com.apple.audio.audiohald")
605        (global-name "com.apple.awdd")
606        (global-name "com.apple.cfprefsd.agent")
607        (global-name "com.apple.cfprefsd.daemon")
608        (global-name "com.apple.cmio.registerassistantservice") ;; Needed by CoreMedia for plugin drivers
609        (global-name "com.apple.cookied")
610        (global-name "com.apple.coreservices.launchservicesd")
611        (global-name "com.apple.diagnosticd")
612        (global-name "com.apple.fonts")
613        (global-name "com.apple.iconservices")
614        (global-name "com.apple.iconservices.store")
615        (global-name "com.apple.mediaremoted.xpc")
616        (global-name "com.apple.logd")
617        (global-name "com.apple.logd.events")
618        (global-name "com.apple.lsd.mapdb")
619        (global-name "com.apple.lskdd") ;; <rdar://problem/49123855>
620        (global-name "com.apple.mobileassetd")
621        (global-name "com.apple.powerlog.plxpclogger.xpc")
622        (global-name "com.apple.system.logger")
623        (global-name "com.apple.tccd")
624        (global-name "com.apple.tccd.system")
625        (global-name "com.apple.trustd.agent")
626 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
627        (global-name "com.apple.CARenderServer") ; Needed for [CAContext remoteContextWithOptions]
628 #else
629        (global-name "com.apple.windowserver.active")
630 #endif
631 )
632
633 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
634 ;; <rdar://problem/47268166>
635 (allow mach-lookup (xpc-service-name "com.apple.MTLCompilerService"))
636 #endif
637
638 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
639 (deny mach-lookup (with no-log)
640     (global-name "com.apple.CoreServices.coreservicesd")
641     (global-name "com.apple.DiskArbitration.diskarbitrationd")
642     (global-name "com.apple.ViewBridgeAuxiliary")
643     (global-name "com.apple.windowserver.active"))
644 #endif
645
646 ;; Needed to support encrypted media playback <rdar://problem/40038478>
647 (allow mach-lookup
648     (global-name "com.apple.SecurityServer")
649     (global-name "com.apple.ocspd"))
650
651 (allow file-read* file-write* (subpath "/private/var/db/mds/system")) ;; FIXME: This should be removed when <rdar://problem/9538414> is fixed.
652
653 (allow file-read*
654        (subpath "/private/var/db/mds")
655        (literal "/private/var/db/DetachedSignatures"))
656
657 (allow ipc-posix-shm-read* ipc-posix-shm-write-data ipc-posix-shm-write-create
658        (ipc-posix-name "com.apple.AppleDatabaseChanged"))
659
660 ;; CoreFoundation. We don't import com.apple.corefoundation.sb, because it allows unnecessary access to pasteboard.
661 (allow mach-lookup
662     (global-name-regex #"^com.apple.distributed_notifications")
663 #if !HAVE(CSCHECKFIXDISABLE)
664     (global-name "com.apple.CoreServices.coreservicesd")
665 #endif
666 )
667
668 (allow file-read-data
669     (literal "/dev/autofs_nowait")) ; Used by CF to circumvent automount triggers
670 (allow ipc-posix-shm
671     (ipc-posix-name-regex #"^CFPBS:")) ; <rdar://problem/13757475>
672 (allow system-fsctl (fsctl-command (_IO "h" 47)))
673
674 ;; Graphics
675 (system-graphics)
676
677 ;; Networking
678 (allow network-outbound
679        ;; Local mDNSResponder for DNS, arbitrary outbound TCP
680        ;; Note: This is needed for some media playback features. <rdar://problem/38191574>
681        ;; Remove this permission when <rdar://problem/38240572> is fixed.
682        (literal "/private/var/run/mDNSResponder")
683        ;; ObjC map_images needs to send logging data to syslog. <rdar://problem/39778918>
684        (literal "/private/var/run/syslog")
685        (remote tcp))
686
687 ;; CFNetwork
688 (allow file-read-data (path "/private/var/db/nsurlstoraged/dafsaData.bin"))
689
690 ;; Network Extensions / VPN helper.
691 (allow mach-lookup
692     (global-name "com.apple.nehelper")
693     (global-name "com.apple.nesessionmanager.content-filter")) ;; <rdar://problem/48442387>
694
695 #if PLATFORM(MAC)
696 ;; FIXME should be removed when <rdar://problem/9347205> + related radar in Safari is fixed
697 (allow mach-lookup
698        (global-name "com.apple.system.logger")
699        (global-name "com.apple.system.notification_center"))
700 #endif
701
702 (if (defined? 'vnode-type)
703         (deny file-write-create (vnode-type SYMLINK)))
704
705 ;; Reserve a namespace for additional protected extended attributes.
706 (deny file-read-xattr file-write-xattr (xattr-regex #"^com\.apple\.security\.private\."))
707
708 (deny file-read* file-write* (with no-log)
709        ;; FIXME: Should be removed after <rdar://problem/10463881> is fixed.
710        (home-literal "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2")
711        (home-literal "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2-journal"))
712
713 ;; Deny access needed for unnecessary NSApplication initialization.
714 ;; FIXME: This can be removed once <rdar://problem/13011633> is fixed.
715 (deny file-read* (with no-log)
716        (subpath "/Library/InputManagers")
717        (home-subpath "/Library/InputManagers"))
718 (deny user-preference-read (with no-log)
719     (preference-domain "com.apple.speech.recognition.AppleSpeechRecognition.prefs"))
720 (deny mach-lookup (with no-log)
721        (global-name "com.apple.coreservices.appleevents")
722        (global-name "com.apple.pasteboard.1")
723        (global-name "com.apple.speech.recognitionserver"))
724 #if PLATFORM(MAC)
725 ;; Also part of unnecessary NSApplication initialization, but we can't block access to these yet, see <rdar://problem/13869765>.
726 (allow file-read*
727        (subpath "/Library/Components")
728        (subpath "/Library/Keyboard Layouts")
729        (subpath "/Library/Input Methods")
730        (home-subpath "/Library/Components")
731        (home-subpath "/Library/Keyboard Layouts")
732        (home-subpath "/Library/Input Methods"))
733 #endif
734
735 ;; AirPlay
736 (allow mach-lookup
737     (global-name "com.apple.coremedia.endpoint.xpc")
738     (global-name "com.apple.coremedia.endpointstream.xpc")
739     (global-name "com.apple.coremedia.endpointplaybacksession.xpc")
740     ; <rdar://problem/35509194>
741     (global-name "com.apple.coremedia.endpointremotecontrolsession.xpc")
742     (global-name "com.apple.coremedia.routediscoverer.xpc")
743     (global-name "com.apple.coremedia.routingcontext.xpc")
744     (global-name "com.apple.coremedia.volumecontroller.xpc")
745 )
746
747 ;; Data Detectors
748 (allow file-read* (subpath "/private/var/db/datadetectors/sys"))
749
750 #if PLATFORM(MAC)
751 ;; Media capture, utilities
752 (if (not (defined? 'sbpl-filter?))
753   (define (sbpl-filter? x)
754       (and (list? x)
755            (eq? (car x) 'filter))))
756
757 (macro (with-filter form)
758    (let* ((ps (cdr form))
759           (extra-filter (car ps))
760           (rules (cdr ps)))
761     `(letrec
762         ((collect
763              (lambda (l filters non-filters)
764                  (if (null? l)
765                      (list filters non-filters)
766                      (let* 
767                          ((x (car l))
768                           (rest (cdr l)))
769                          (if (sbpl-filter? x)
770                              (collect rest (cons x filters) non-filters)
771                              (collect rest filters (cons x non-filters)))))))
772          (inject-filter
773              (lambda args
774                  (let* ((collected (collect args '() '()))
775                         (filters (car collected))
776                         (non-filters (cadr collected)))
777                  (if (null? filters)
778                      (cons ,extra-filter non-filters)
779                      (cons (require-all (apply require-any filters) ,extra-filter) non-filters)))))
780          (orig-allow allow)
781          (orig-deny deny)
782          (wrapper
783              (lambda (action)
784                  (lambda args (apply action (apply inject-filter args))))))
785         (set! allow (wrapper orig-allow))
786         (set! deny (wrapper orig-deny))
787         ,@rules
788         (set! deny orig-deny)
789         (set! allow orig-allow))))
790
791 (define (home-library-preferences-regex home-library-preferences-relative-regex)
792     (regex (string-append "^" (regex-quote (param "HOME_LIBRARY_PREFERENCES_DIR")) home-library-preferences-relative-regex)))
793
794 (define (home-library-preferences-literal home-library-preferences-relative-literal)
795     (literal (string-append (param "HOME_LIBRARY_PREFERENCES_DIR") home-library-preferences-relative-literal)))
796
797 (define (shared-preferences-read . domains)
798   (for-each (lambda (domain)
799               (begin
800                 (if (defined? `user-preference-read)
801                     (allow user-preference-read (preference-domain domain)))
802                 ; (Temporary) backward compatibility with non-CFPreferences readers.
803                 (allow file-read*
804                        (literal (string-append "/Library/Preferences/" domain ".plist"))
805                        (home-library-preferences-literal (string-append "/" domain ".plist"))
806                        (home-library-preferences-regex (string-append #"/ByHost/" (regex-quote domain) #"\..*\.plist$")))))
807             domains))
808
809 ;; Media capture, microphone access
810 (with-filter (extension "com.apple.webkit.microphone")
811     (allow device-microphone))
812
813 ;; Media capture, camera access
814 (with-filter (extension "com.apple.webkit.camera")
815     (shared-preferences-read "com.apple.coremedia")
816     (allow file-read* (subpath "/Library/CoreMediaIO/Plug-Ins/DAL"))
817     (allow mach-lookup (extension "com.apple.app-sandbox.mach"))
818     (allow mach-lookup
819         (global-name "com.apple.cmio.AppleCameraAssistant")
820         ;; Apple DAL assistants
821         (global-name "com.apple.cmio.VDCAssistant")
822         (global-name "com.apple.cmio.AVCAssistant")
823         (global-name "com.apple.cmio.IIDCVideoAssistant")
824         ;; QuickTimeIIDCDigitizer assistant
825         (global-name "com.apple.IIDCAssistant"))
826     (allow iokit-open
827         ;; QuickTimeUSBVDCDigitizer
828         (iokit-user-client-class "IOUSBDeviceUserClientV2")
829         (iokit-user-client-class "IOUSBInterfaceUserClientV2"))
830     (allow device-camera))
831 #endif // PLATFORM(MAC)
832
833 (when (defined? 'syscall-unix)
834     (deny syscall-unix (with send-signal SIGKILL))
835     (allow syscall-unix
836         (syscall-number SYS_exit)
837         (syscall-number SYS_read)
838         (syscall-number SYS_write)
839         (syscall-number SYS_open)
840         (syscall-number SYS_close)
841         (syscall-number SYS_unlink)
842         (syscall-number SYS_chmod)
843         (syscall-number SYS_getuid)
844         (syscall-number SYS_geteuid)
845         (syscall-number SYS_recvfrom)
846         (syscall-number SYS_getpeername)
847         (syscall-number SYS_access)
848         (syscall-number SYS_dup)
849         (syscall-number SYS_pipe)
850         (syscall-number SYS_getegid)
851         (syscall-number SYS_getgid)
852         (syscall-number SYS_sigprocmask)
853         (syscall-number SYS_sigaltstack)
854         (syscall-number SYS_ioctl)
855         (syscall-number SYS_readlink)
856         (syscall-number SYS_umask)
857         (syscall-number SYS_msync)
858         (syscall-number SYS_munmap)
859         (syscall-number SYS_mprotect)
860         (syscall-number SYS_madvise)
861         (syscall-number SYS_fcntl)
862         (syscall-number SYS_select)
863         (syscall-number SYS_fsync)
864         (syscall-number SYS_setpriority)
865         (syscall-number SYS_socket)
866         (syscall-number SYS_connect)
867         (syscall-number SYS_setsockopt)
868         (syscall-number SYS_gettimeofday)
869         (syscall-number SYS_getrusage)
870         (syscall-number SYS_getsockopt)
871         (syscall-number SYS_writev)
872         (syscall-number SYS_fchmod)
873         (syscall-number SYS_rename)
874         (syscall-number SYS_flock)
875         (syscall-number SYS_sendto)
876         (syscall-number SYS_shutdown)
877         (syscall-number SYS_socketpair)
878         (syscall-number SYS_mkdir)
879         (syscall-number SYS_rmdir)
880         (syscall-number SYS_pread)
881         (syscall-number SYS_pwrite)
882         (syscall-number SYS_csops)
883         (syscall-number SYS_csops_audittoken)
884         (syscall-number SYS_kdebug_trace64)
885         (syscall-number SYS_kdebug_trace)
886         (syscall-number SYS_sigreturn)
887         (syscall-number SYS_pathconf)
888         (syscall-number SYS_getrlimit)
889         (syscall-number SYS_setrlimit)
890         (syscall-number SYS_mmap)
891         (syscall-number SYS_lseek)
892         (syscall-number SYS_ftruncate)
893         (syscall-number SYS_sysctl)
894         (syscall-number SYS_mlock)
895         (syscall-number SYS_munlock)
896         (syscall-number SYS_getattrlist)
897         (syscall-number SYS_getxattr)
898         (syscall-number SYS_fgetxattr)
899         (syscall-number SYS_listxattr)
900         (syscall-number SYS_shm_open)
901         (syscall-number SYS_sem_wait)
902         (syscall-number SYS_sem_post)
903         (syscall-number SYS_sysctlbyname)
904         (syscall-number SYS_psynch_mutexwait)
905         (syscall-number SYS_psynch_mutexdrop)
906         (syscall-number SYS_psynch_cvbroad)
907         (syscall-number SYS_psynch_cvsignal)
908         (syscall-number SYS_psynch_cvwait)
909         (syscall-number SYS_psynch_rw_wrlock)
910         (syscall-number SYS_psynch_rw_unlock)
911         (syscall-number SYS_psynch_cvclrprepost)
912         (syscall-number SYS_process_policy)
913         (syscall-number SYS_issetugid)
914         (syscall-number SYS___pthread_kill)
915         (syscall-number SYS___pthread_sigmask)
916         (syscall-number SYS___disable_threadsignal)
917         (syscall-number SYS___semwait_signal)
918         (syscall-number SYS_proc_info)
919         (syscall-number SYS_stat64)
920         (syscall-number SYS_fstat64)
921         (syscall-number SYS_lstat64)
922         (syscall-number SYS_getdirentries64)
923         (syscall-number SYS_statfs64)
924         (syscall-number SYS_fstatfs64)
925         (syscall-number SYS_getfsstat64)
926         (syscall-number SYS_getaudit_addr)
927         (syscall-number SYS_bsdthread_create)
928         (syscall-number SYS_bsdthread_terminate)
929         (syscall-number SYS_workq_kernreturn)
930         (syscall-number SYS_thread_selfid)
931         (syscall-number SYS_kevent_qos)
932         (syscall-number SYS_kevent_id)
933         (syscall-number SYS___mac_syscall)
934         (syscall-number SYS_read_nocancel)
935         (syscall-number SYS_write_nocancel)
936         (syscall-number SYS_open_nocancel)
937         (syscall-number SYS_close_nocancel)
938         (syscall-number SYS_sendmsg_nocancel)
939         (syscall-number SYS_recvfrom_nocancel)
940         (syscall-number SYS_fcntl_nocancel)
941         (syscall-number SYS_select_nocancel)
942         (syscall-number SYS_connect_nocancel)
943         (syscall-number SYS_sendto_nocancel)
944         (syscall-number SYS_fsgetpath)
945         (syscall-number SYS_fileport_makeport)
946         (syscall-number SYS_guarded_open_np)
947         (syscall-number SYS_guarded_close_np)
948         (syscall-number SYS_change_fdguard_np)
949         (syscall-number SYS_proc_rlimit_control)
950         (syscall-number SYS_connectx)
951         (syscall-number SYS_getattrlistbulk)
952         (syscall-number SYS_openat)
953         (syscall-number SYS_openat_nocancel)
954         (syscall-number SYS_fstatat64)
955         (syscall-number SYS_mkdirat)
956         (syscall-number SYS_bsdthread_ctl)
957         (syscall-number SYS_csrctl)
958         (syscall-number SYS_guarded_pwrite_np)
959         (syscall-number SYS_getentropy)
960         (syscall-number SYS_necp_open)
961         (syscall-number SYS_necp_client_action)
962         (syscall-number SYS_ulock_wait)
963         (syscall-number SYS_ulock_wake)
964         (syscall-number SYS_work_interval_ctl)
965         (syscall-number SYS_kdebug_typefilter)
966         (syscall-number SYS_gettid) ;; Needed for base system, see <rdar://problem/48651255>
967         (syscall-number SYS_memorystatus_control) ;; Needed for memory measurement infrastructure, see <rdar://problem/48647263>
968         (syscall-number SYS_kdebug_trace_string) ;; Needed for performance sampling, see <rdar://problem/48829655>.
969         (syscall-number SYS_psynch_rw_rdlock) ;; <rdar://problem/49060359>
970         (syscall-number SYS_terminate_with_payload) ;; <rdar://problem/50026580>
971         (syscall-number SYS_quotactl) ;; <rdar://problem/49945031>
972         (syscall-number SYS_stat64_extended) ;; <rdar://problem/50473330>
973         (syscall-number SYS_lstat64_extended)
974         (syscall-number SYS_iopolicysys)
975         (syscall-number SYS_workq_open)
976         (syscall-number SYS_getgroups)
977         (syscall-number SYS_fgetattrlist) ;; <rdar://problem/50931110>
978         (syscall-number SYS_kqueue) ;; <rdar://problem/49609201>
979         (syscall-number SYS_kqueue_workloop_ctl) ;; <rdar://problem/50999499>
980         (syscall-number SYS_open_dprotected_np)
981         (syscall-number SYS_flistxattr)
982         (syscall-number SYS_fsetattrlist)
983         (syscall-number SYS_fchown)
984         (syscall-number SYS_fchflags)
985         (syscall-number SYS_fstat64_extended)
986     )
987 )
988