da7c39c4fceb3ce113045b49e75408ca1675dbc1
[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.ATS"
485         "com.apple.CoreGraphics"
486         "com.apple.DownloadAssessment"
487         "com.apple.HIToolbox"
488         "com.apple.LaunchServices"
489         "com.apple.MultitouchSupport" ;; FIXME: Remove when <rdar://problem/13011633> is fixed.
490         "com.apple.ServicesMenu.Services" ;; Needed for NSAttributedString <rdar://problem/10844321>
491         "com.apple.ViewBridge" ;; Needed for Input elements.
492         "com.apple.WebFoundation"
493         "com.apple.avfoundation"
494         "com.apple.avfoundation.frecents" ;; <rdar://problem/33137029>
495         "com.apple.avfoundation.videoperformancehud" ;; <rdar://problem/31594568>
496         "com.apple.coremedia"
497         "com.apple.crypto"
498         "com.apple.driver.AppleBluetoothMultitouch.mouse"
499         "com.apple.driver.AppleBluetoothMultitouch.trackpad"
500         "com.apple.driver.AppleHIDMouse"
501         "com.apple.lookup.shared"
502         "com.apple.mediaaccessibility" ;; Needed for custom caption styles
503         "com.apple.networkConnect"
504         "com.apple.speech.voice.prefs"
505         "com.apple.systemsound"
506         "com.apple.universalaccess"
507         "edu.mit.Kerberos"
508         "pbs" ;; Needed for NSAttributedString <rdar://problem/10844321>
509 ))
510
511 ; (Temporary) backward compatibility with non-CFPreferences readers.
512 (allow file-read*
513     (literal "/Library/Preferences/com.apple.ViewBridge.plist"))
514
515 ; FIXME: This is needed for some security framework calls (that use non-CFPreferences readers)
516 (allow file-read-data
517     (literal "/Library/Preferences/com.apple.security.plist")
518     (home-subpath "/Library/Preferences/com.apple.security.plist"))
519
520 ;; On-disk WebKit2 framework location, to account for debug installations outside of /System/Library/Frameworks,
521 ;; and to allow issuing extensions.
522 (allow-read-directory-and-issue-read-extensions (param "WEBKIT2_FRAMEWORK_DIR"))
523
524 ;; Allow issuing extensions to system libraries that the Network process can already read.
525 ;; This is to avoid warnings attempting to create extensions for these resources.
526 (allow-read-directory-and-issue-read-extensions "/System/Library/PrivateFrameworks/WebInspectorUI.framework")
527
528 ;; Sandbox extensions
529 (define (apply-read-and-issue-extension op path-filter)
530     (op file-read* path-filter)
531     (op file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read") path-filter)))
532 (define (apply-write-and-issue-extension op path-filter)
533     (op file-write* path-filter)
534     (op file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read-write") path-filter)))
535 (define (read-only-and-issue-extensions path-filter)
536     (apply-read-and-issue-extension allow path-filter))
537 (define (read-write-and-issue-extensions path-filter)
538     (apply-read-and-issue-extension allow path-filter)
539     (apply-write-and-issue-extension allow path-filter))
540 (read-only-and-issue-extensions (extension "com.apple.app-sandbox.read"))
541 (read-write-and-issue-extensions (extension "com.apple.app-sandbox.read-write"))
542 (allow mach-lookup (extension "com.apple.app-sandbox.mach")) ;; FIXME: Should be removed when <rdar://problem/13066206> is fixed.
543
544 ;; Allow the OpenGL Profiler to attach.
545 (if (defined? 'mach-register)
546     (allow mach-register (global-name-regex #"^_oglprof_attach_<[0-9]+>$")))
547
548 (if (positive? (string-length (param "DARWIN_USER_CACHE_DIR")))
549     (allow-read-write-directory-and-issue-read-write-extensions (param "DARWIN_USER_CACHE_DIR")))
550
551 (if (positive? (string-length (param "DARWIN_USER_TEMP_DIR")))
552     (allow-read-write-directory-and-issue-read-write-extensions (param "DARWIN_USER_TEMP_DIR")))
553
554 ;; IOKit user clients
555 (allow iokit-open
556     (iokit-user-client-class "AppleMultitouchDeviceUserClient")
557     (iokit-user-client-class "AppleUpstreamUserClient")
558     (iokit-user-client-class "IOHIDParamUserClient")
559     (iokit-user-client-class "RootDomainUserClient")
560     (iokit-user-client-class "IOAudioControlUserClient")
561     (iokit-user-client-class "IOAudioEngineUserClient")
562     ;; Following is needed due to <rdar://problem/10427451> && <rdar://problem/10808817>
563     (iokit-user-client-class "AudioAUUC"))
564
565 ;; cookied.
566 ;; FIXME: Update for <rdar://problem/13642852>.
567 (allow ipc-posix-shm-read-data
568     (ipc-posix-name "FNetwork.defaultStorageSession")
569     (ipc-posix-name-regex #"\.PrivateBrowsing-")
570     (ipc-posix-name-regex #"^WebKit Test-"))
571
572 ;; ColorSync
573 (allow ipc-posix-shm*
574     (ipc-posix-name "com.apple.ColorSync.Gen.lock")
575     (ipc-posix-name "com.apple.ColorSync.Disp.lock")
576     (ipc-posix-name "com.apple.ColorSync.Gray2.2")
577     (ipc-posix-name "com.apple.ColorSync.sRGB")
578     (ipc-posix-name "com.apple.ColorSync.GenGray")
579     (ipc-posix-name "com.apple.ColorSync.GenRGB"))
580
581 ;; Audio
582 (allow ipc-posix-shm-read* ipc-posix-shm-write-data
583     (ipc-posix-name-regex #"^AudioIO"))
584
585 ;; Remote Web Inspector
586 (allow mach-lookup
587        (global-name "com.apple.webinspector"))
588
589 (allow mach-lookup
590     (global-name "com.apple.FileCoordination"))
591
592 ;; Various services required by AppKit and other frameworks
593 (allow mach-lookup
594 #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101400
595        (global-name "com.apple.FontObjectsServer")
596 #endif
597        (global-name "com.apple.PowerManagement.control")
598        (global-name "com.apple.SystemConfiguration.configd")
599        (global-name "com.apple.analyticsd")
600        (global-name "com.apple.audio.AudioComponentRegistrar")
601        (global-name "com.apple.assertiond.processassertionconnection")
602        (global-name "com.apple.audio.SystemSoundServer-OSX")
603        (global-name "com.apple.audio.audiohald")
604        (global-name "com.apple.awdd")
605        (global-name "com.apple.cfprefsd.agent")
606        (global-name "com.apple.cfprefsd.daemon")
607        (global-name "com.apple.cmio.registerassistantservice") ;; Needed by CoreMedia for plugin drivers
608        (global-name "com.apple.cookied")
609        (global-name "com.apple.coreservices.launchservicesd")
610        (global-name "com.apple.diagnosticd")
611        (global-name "com.apple.fonts")
612        (global-name "com.apple.iconservices")
613        (global-name "com.apple.iconservices.store")
614        (global-name "com.apple.mediaremoted.xpc")
615        (global-name "com.apple.logd")
616        (global-name "com.apple.logd.events")
617        (global-name "com.apple.lsd.mapdb")
618        (global-name "com.apple.lskdd") ;; <rdar://problem/49123855>
619        (global-name "com.apple.mobileassetd")
620        (global-name "com.apple.powerlog.plxpclogger.xpc")
621        (global-name "com.apple.system.logger")
622        (global-name "com.apple.tccd")
623        (global-name "com.apple.tccd.system")
624        (global-name "com.apple.trustd.agent")
625 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
626        (global-name "com.apple.CARenderServer") ; Needed for [CAContext remoteContextWithOptions]
627 #else
628        (global-name "com.apple.windowserver.active")
629 #endif
630 )
631
632 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
633 ;; <rdar://problem/47268166>
634 (allow mach-lookup (xpc-service-name "com.apple.MTLCompilerService"))
635 #endif
636
637 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 || PLATFORM(MACCATALYST)
638 (deny mach-lookup (with no-log)
639     (global-name "com.apple.CoreServices.coreservicesd")
640     (global-name "com.apple.DiskArbitration.diskarbitrationd")
641     (global-name "com.apple.ViewBridgeAuxiliary")
642     (global-name "com.apple.windowserver.active"))
643 #endif
644
645 ;; Needed to support encrypted media playback <rdar://problem/40038478>
646 (allow mach-lookup
647     (global-name "com.apple.SecurityServer")
648     (global-name "com.apple.ocspd"))
649
650 (allow file-read* file-write* (subpath "/private/var/db/mds/system")) ;; FIXME: This should be removed when <rdar://problem/9538414> is fixed.
651
652 (allow file-read*
653        (subpath "/private/var/db/mds")
654        (literal "/private/var/db/DetachedSignatures"))
655
656 (allow ipc-posix-shm-read* ipc-posix-shm-write-data ipc-posix-shm-write-create
657        (ipc-posix-name "com.apple.AppleDatabaseChanged"))
658
659 ;; CoreFoundation. We don't import com.apple.corefoundation.sb, because it allows unnecessary access to pasteboard.
660 (allow mach-lookup
661     (global-name-regex #"^com.apple.distributed_notifications")
662 #if !HAVE(CSCHECKFIXDISABLE)
663     (global-name "com.apple.CoreServices.coreservicesd")
664 #endif
665 )
666
667 (allow file-read-data
668     (literal "/dev/autofs_nowait")) ; Used by CF to circumvent automount triggers
669 (allow ipc-posix-shm
670     (ipc-posix-name-regex #"^CFPBS:")) ; <rdar://problem/13757475>
671 (allow system-fsctl (fsctl-command (_IO "h" 47)))
672
673 ;; Graphics
674 (system-graphics)
675
676 ;; Networking
677 (allow network-outbound
678        ;; Local mDNSResponder for DNS, arbitrary outbound TCP
679        ;; Note: This is needed for some media playback features. <rdar://problem/38191574>
680        ;; Remove this permission when <rdar://problem/38240572> is fixed.
681        (literal "/private/var/run/mDNSResponder")
682        ;; ObjC map_images needs to send logging data to syslog. <rdar://problem/39778918>
683        (literal "/private/var/run/syslog")
684        (remote tcp))
685
686 ;; CFNetwork
687 (allow file-read-data (path "/private/var/db/nsurlstoraged/dafsaData.bin"))
688
689 ;; Network Extensions / VPN helper.
690 (allow mach-lookup
691     (global-name "com.apple.nehelper")
692     (global-name "com.apple.nesessionmanager.content-filter")) ;; <rdar://problem/48442387>
693
694 #if PLATFORM(MAC)
695 ;; FIXME should be removed when <rdar://problem/9347205> + related radar in Safari is fixed
696 (allow mach-lookup
697        (global-name "com.apple.system.logger")
698        (global-name "com.apple.system.notification_center"))
699 #endif
700
701 (if (defined? 'vnode-type)
702         (deny file-write-create (vnode-type SYMLINK)))
703
704 ;; Reserve a namespace for additional protected extended attributes.
705 (deny file-read-xattr file-write-xattr (xattr-regex #"^com\.apple\.security\.private\."))
706
707 (deny file-read* file-write* (with no-log)
708        ;; FIXME: Should be removed after <rdar://problem/10463881> is fixed.
709        (home-literal "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2")
710        (home-literal "/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2-journal"))
711
712 ;; Deny access needed for unnecessary NSApplication initialization.
713 ;; FIXME: This can be removed once <rdar://problem/13011633> is fixed.
714 (deny file-read* (with no-log)
715        (subpath "/Library/InputManagers")
716        (home-subpath "/Library/InputManagers"))
717 (deny user-preference-read (with no-log)
718     (preference-domain "com.apple.speech.recognition.AppleSpeechRecognition.prefs"))
719 (deny mach-lookup (with no-log)
720        (global-name "com.apple.coreservices.appleevents")
721        (global-name "com.apple.pasteboard.1")
722        (global-name "com.apple.speech.recognitionserver"))
723 #if PLATFORM(MAC)
724 ;; Also part of unnecessary NSApplication initialization, but we can't block access to these yet, see <rdar://problem/13869765>.
725 (allow file-read*
726        (subpath "/Library/Components")
727        (subpath "/Library/Keyboard Layouts")
728        (subpath "/Library/Input Methods")
729        (home-subpath "/Library/Components")
730        (home-subpath "/Library/Keyboard Layouts")
731        (home-subpath "/Library/Input Methods"))
732 #endif
733
734 ;; AirPlay
735 (allow mach-lookup
736     (global-name "com.apple.coremedia.endpoint.xpc")
737     (global-name "com.apple.coremedia.endpointstream.xpc")
738     (global-name "com.apple.coremedia.endpointplaybacksession.xpc")
739     ; <rdar://problem/35509194>
740     (global-name "com.apple.coremedia.endpointremotecontrolsession.xpc")
741     (global-name "com.apple.coremedia.routediscoverer.xpc")
742     (global-name "com.apple.coremedia.routingcontext.xpc")
743     (global-name "com.apple.coremedia.volumecontroller.xpc")
744 )
745
746 ;; Data Detectors
747 (allow file-read* (subpath "/private/var/db/datadetectors/sys"))
748
749 #if PLATFORM(MAC)
750 ;; Media capture, utilities
751 (if (not (defined? 'sbpl-filter?))
752   (define (sbpl-filter? x)
753       (and (list? x)
754            (eq? (car x) 'filter))))
755
756 (macro (with-filter form)
757    (let* ((ps (cdr form))
758           (extra-filter (car ps))
759           (rules (cdr ps)))
760     `(letrec
761         ((collect
762              (lambda (l filters non-filters)
763                  (if (null? l)
764                      (list filters non-filters)
765                      (let* 
766                          ((x (car l))
767                           (rest (cdr l)))
768                          (if (sbpl-filter? x)
769                              (collect rest (cons x filters) non-filters)
770                              (collect rest filters (cons x non-filters)))))))
771          (inject-filter
772              (lambda args
773                  (let* ((collected (collect args '() '()))
774                         (filters (car collected))
775                         (non-filters (cadr collected)))
776                  (if (null? filters)
777                      (cons ,extra-filter non-filters)
778                      (cons (require-all (apply require-any filters) ,extra-filter) non-filters)))))
779          (orig-allow allow)
780          (orig-deny deny)
781          (wrapper
782              (lambda (action)
783                  (lambda args (apply action (apply inject-filter args))))))
784         (set! allow (wrapper orig-allow))
785         (set! deny (wrapper orig-deny))
786         ,@rules
787         (set! deny orig-deny)
788         (set! allow orig-allow))))
789
790 (define (home-library-preferences-regex home-library-preferences-relative-regex)
791     (regex (string-append "^" (regex-quote (param "HOME_LIBRARY_PREFERENCES_DIR")) home-library-preferences-relative-regex)))
792
793 (define (home-library-preferences-literal home-library-preferences-relative-literal)
794     (literal (string-append (param "HOME_LIBRARY_PREFERENCES_DIR") home-library-preferences-relative-literal)))
795
796 (define (shared-preferences-read . domains)
797   (for-each (lambda (domain)
798               (begin
799                 (if (defined? `user-preference-read)
800                     (allow user-preference-read (preference-domain domain)))
801                 ; (Temporary) backward compatibility with non-CFPreferences readers.
802                 (allow file-read*
803                        (literal (string-append "/Library/Preferences/" domain ".plist"))
804                        (home-library-preferences-literal (string-append "/" domain ".plist"))
805                        (home-library-preferences-regex (string-append #"/ByHost/" (regex-quote domain) #"\..*\.plist$")))))
806             domains))
807
808 ;; Media capture, microphone access
809 (with-filter (extension "com.apple.webkit.microphone")
810     (allow device-microphone))
811
812 ;; Media capture, camera access
813 (with-filter (extension "com.apple.webkit.camera")
814     (shared-preferences-read "com.apple.coremedia")
815     (allow file-read* (subpath "/Library/CoreMediaIO/Plug-Ins/DAL"))
816     (allow mach-lookup (extension "com.apple.app-sandbox.mach"))
817     (allow mach-lookup
818         (global-name "com.apple.cmio.AppleCameraAssistant")
819         ;; Apple DAL assistants
820         (global-name "com.apple.cmio.VDCAssistant")
821         (global-name "com.apple.cmio.AVCAssistant")
822         (global-name "com.apple.cmio.IIDCVideoAssistant")
823         ;; QuickTimeIIDCDigitizer assistant
824         (global-name "com.apple.IIDCAssistant"))
825     (allow iokit-open
826         ;; QuickTimeUSBVDCDigitizer
827         (iokit-user-client-class "IOUSBDeviceUserClientV2")
828         (iokit-user-client-class "IOUSBInterfaceUserClientV2"))
829     (allow device-camera))
830 #endif // PLATFORM(MAC)
831
832 (when (defined? 'syscall-unix)
833     (deny syscall-unix (with send-signal SIGKILL))
834     (allow syscall-unix
835         (syscall-number SYS_exit)
836         (syscall-number SYS_read)
837         (syscall-number SYS_write)
838         (syscall-number SYS_open)
839         (syscall-number SYS_close)
840         (syscall-number SYS_unlink)
841         (syscall-number SYS_chmod)
842         (syscall-number SYS_getuid)
843         (syscall-number SYS_geteuid)
844         (syscall-number SYS_recvfrom)
845         (syscall-number SYS_getpeername)
846         (syscall-number SYS_access)
847         (syscall-number SYS_dup)
848         (syscall-number SYS_pipe)
849         (syscall-number SYS_getegid)
850         (syscall-number SYS_getgid)
851         (syscall-number SYS_sigprocmask)
852         (syscall-number SYS_sigaltstack)
853         (syscall-number SYS_ioctl)
854         (syscall-number SYS_readlink)
855         (syscall-number SYS_umask)
856         (syscall-number SYS_msync)
857         (syscall-number SYS_munmap)
858         (syscall-number SYS_mprotect)
859         (syscall-number SYS_madvise)
860         (syscall-number SYS_fcntl)
861         (syscall-number SYS_select)
862         (syscall-number SYS_fsync)
863         (syscall-number SYS_setpriority)
864         (syscall-number SYS_socket)
865         (syscall-number SYS_connect)
866         (syscall-number SYS_setsockopt)
867         (syscall-number SYS_gettimeofday)
868         (syscall-number SYS_getrusage)
869         (syscall-number SYS_getsockopt)
870         (syscall-number SYS_writev)
871         (syscall-number SYS_fchmod)
872         (syscall-number SYS_rename)
873         (syscall-number SYS_flock)
874         (syscall-number SYS_sendto)
875         (syscall-number SYS_shutdown)
876         (syscall-number SYS_socketpair)
877         (syscall-number SYS_mkdir)
878         (syscall-number SYS_rmdir)
879         (syscall-number SYS_pread)
880         (syscall-number SYS_pwrite)
881         (syscall-number SYS_csops)
882         (syscall-number SYS_csops_audittoken)
883         (syscall-number SYS_kdebug_trace64)
884         (syscall-number SYS_kdebug_trace)
885         (syscall-number SYS_sigreturn)
886         (syscall-number SYS_pathconf)
887         (syscall-number SYS_getrlimit)
888         (syscall-number SYS_setrlimit)
889         (syscall-number SYS_mmap)
890         (syscall-number SYS_lseek)
891         (syscall-number SYS_ftruncate)
892         (syscall-number SYS_sysctl)
893         (syscall-number SYS_mlock)
894         (syscall-number SYS_munlock)
895         (syscall-number SYS_getattrlist)
896         (syscall-number SYS_getxattr)
897         (syscall-number SYS_fgetxattr)
898         (syscall-number SYS_listxattr)
899         (syscall-number SYS_shm_open)
900         (syscall-number SYS_sem_wait)
901         (syscall-number SYS_sem_post)
902         (syscall-number SYS_sysctlbyname)
903         (syscall-number SYS_psynch_mutexwait)
904         (syscall-number SYS_psynch_mutexdrop)
905         (syscall-number SYS_psynch_cvbroad)
906         (syscall-number SYS_psynch_cvsignal)
907         (syscall-number SYS_psynch_cvwait)
908         (syscall-number SYS_psynch_rw_wrlock)
909         (syscall-number SYS_psynch_rw_unlock)
910         (syscall-number SYS_psynch_cvclrprepost)
911         (syscall-number SYS_process_policy)
912         (syscall-number SYS_issetugid)
913         (syscall-number SYS___pthread_kill)
914         (syscall-number SYS___pthread_sigmask)
915         (syscall-number SYS___disable_threadsignal)
916         (syscall-number SYS___semwait_signal)
917         (syscall-number SYS_proc_info)
918         (syscall-number SYS_stat64)
919         (syscall-number SYS_fstat64)
920         (syscall-number SYS_lstat64)
921         (syscall-number SYS_getdirentries64)
922         (syscall-number SYS_statfs64)
923         (syscall-number SYS_fstatfs64)
924         (syscall-number SYS_getfsstat64)
925         (syscall-number SYS_getaudit_addr)
926         (syscall-number SYS_bsdthread_create)
927         (syscall-number SYS_bsdthread_terminate)
928         (syscall-number SYS_workq_kernreturn)
929         (syscall-number SYS_thread_selfid)
930         (syscall-number SYS_kevent_qos)
931         (syscall-number SYS_kevent_id)
932         (syscall-number SYS___mac_syscall)
933         (syscall-number SYS_read_nocancel)
934         (syscall-number SYS_write_nocancel)
935         (syscall-number SYS_open_nocancel)
936         (syscall-number SYS_close_nocancel)
937         (syscall-number SYS_sendmsg_nocancel)
938         (syscall-number SYS_recvfrom_nocancel)
939         (syscall-number SYS_fcntl_nocancel)
940         (syscall-number SYS_select_nocancel)
941         (syscall-number SYS_connect_nocancel)
942         (syscall-number SYS_sendto_nocancel)
943         (syscall-number SYS_fsgetpath)
944         (syscall-number SYS_fileport_makeport)
945         (syscall-number SYS_guarded_open_np)
946         (syscall-number SYS_guarded_close_np)
947         (syscall-number SYS_change_fdguard_np)
948         (syscall-number SYS_proc_rlimit_control)
949         (syscall-number SYS_connectx)
950         (syscall-number SYS_getattrlistbulk)
951         (syscall-number SYS_openat)
952         (syscall-number SYS_openat_nocancel)
953         (syscall-number SYS_fstatat64)
954         (syscall-number SYS_mkdirat)
955         (syscall-number SYS_bsdthread_ctl)
956         (syscall-number SYS_csrctl)
957         (syscall-number SYS_guarded_pwrite_np)
958         (syscall-number SYS_getentropy)
959         (syscall-number SYS_necp_open)
960         (syscall-number SYS_necp_client_action)
961         (syscall-number SYS_ulock_wait)
962         (syscall-number SYS_ulock_wake)
963         (syscall-number SYS_work_interval_ctl)
964         (syscall-number SYS_kdebug_typefilter)
965         (syscall-number SYS_gettid) ;; Needed for base system, see <rdar://problem/48651255>
966         (syscall-number SYS_memorystatus_control) ;; Needed for memory measurement infrastructure, see <rdar://problem/48647263>
967         (syscall-number SYS_kdebug_trace_string) ;; Needed for performance sampling, see <rdar://problem/48829655>.
968         (syscall-number SYS_psynch_rw_rdlock) ;; <rdar://problem/49060359>
969         (syscall-number SYS_terminate_with_payload) ;; <rdar://problem/50026580>
970         (syscall-number SYS_quotactl) ;; <rdar://problem/49945031>
971         (syscall-number SYS_stat64_extended) ;; <rdar://problem/50473330>
972         (syscall-number SYS_lstat64_extended)
973         (syscall-number SYS_iopolicysys)
974         (syscall-number SYS_workq_open)
975         (syscall-number SYS_getgroups)
976         (syscall-number SYS_fgetattrlist) ;; <rdar://problem/50931110>
977         (syscall-number SYS_kqueue) ;; <rdar://problem/49609201>
978         (syscall-number SYS_kqueue_workloop_ctl) ;; <rdar://problem/50999499>
979         (syscall-number SYS_open_dprotected_np)
980         (syscall-number SYS_flistxattr)
981         (syscall-number SYS_fsetattrlist)
982         (syscall-number SYS_fchown)
983         (syscall-number SYS_fchflags)
984         (syscall-number SYS_fstat64_extended)
985     )
986 )
987