Skip to content

Commit 3862386

Browse files
Consolidate sysctl-read rules in WebProcess sandbox
https://bugs.webkit.org/show_bug.cgi?id=179674 <rdar://problem/35367154> Reviewed by Dean Jackson. Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into the main function in the sandbox profile. Remove the statement to grant global sysctl-read permissions that was copied into this sandbox profile in an earlier checkin. We started blocking the blanket read permissions in macOS 10.13, and want to continue to do so. The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads to occur before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking systcl reads from the start, we need to add whitelist entries for a few more entries to avoid creating new sandbox violations. * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 23d2ba4 commit 3862386

File tree

2 files changed

+40
-7
lines changed

2 files changed

+40
-7
lines changed

Source/WebKit/ChangeLog

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
2017-11-14 Brent Fulgham <[email protected]>
2+
3+
Consolidate sysctl-read rules in WebProcess sandbox
4+
https://bugs.webkit.org/show_bug.cgi?id=179674
5+
<rdar://problem/35367154>
6+
7+
Reviewed by Dean Jackson.
8+
9+
Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into
10+
the main function in the sandbox profile.
11+
12+
Remove the statement to grant global sysctl-read permissions that was copied into this
13+
sandbox profile in an earlier checkin. We started blocking the blanket read permissions in
14+
macOS 10.13, and want to continue to do so.
15+
16+
The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads
17+
to occur before we hit the block declaration in the WebContent sandbox. Now that we are
18+
consistently blocking systcl reads from the start, we need to add whitelist entries for a
19+
few more entries to avoid creating new sandbox violations.
20+
21+
* WebProcess/com.apple.WebProcess.sb.in:
22+
123
2017-11-14 Alex Christensen <[email protected]>
224

325
Remove WebKit CFURLConnection code

Source/WebKit/WebProcess/com.apple.WebProcess.sb.in

+18-7
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@
9494
(ipc-posix-name "apple.shm.notification_center")
9595
(ipc-posix-name-prefix "apple.cfprefs."))
9696

97-
;;; Allow mostly harmless operations.
98-
(allow sysctl-read)
99-
100-
10197
;;; (system-graphics) - Allow access to graphics hardware.
10298
(define (system-graphics)
10399
;; Preferences
@@ -181,11 +177,26 @@
181177
(deny sysctl*)
182178
(allow sysctl-read
183179
(sysctl-name
184-
"hw.availcpu"
185-
"hw.ncpu"
180+
"hw.busfrequency_max"
181+
"hw.cputype"
182+
"hw.l2cachesize"
183+
"hw.machine"
184+
"hw.memsize"
186185
"hw.model"
186+
"hw.ncpu"
187+
"hw.vectorunit"
188+
"kern.hostname"
189+
"kern.maxfilesperproc"
187190
"kern.memorystatus_level"
188-
"vm.footprint_suspend"))
191+
"kern.safeboot"
192+
"kern.version"
193+
"vm.footprint_suspend")
194+
(sysctl-name-regex #"^hw.(active|avail)cpu")
195+
(sysctl-name-regex #"^hw.(logical|physical)cpu_max")
196+
(sysctl-name-regex #"^hw.optional\.")
197+
(sysctl-name-regex #"^kern.os(release|type|variant_status|version)")
198+
(sysctl-name-regex #"^net.routetable")
199+
)
189200

190201
(deny iokit-get-properties)
191202
(allow iokit-get-properties

0 commit comments

Comments
 (0)