Commit graph

859 commits

Author SHA1 Message Date
Nick Kralevich
65d4e8355b am 006260e5: Merge "Confine hostapd, but leave it permissive for now."
* commit '006260e528f4bcd6fa7db6e1acc5d38224eb401b':
  Confine hostapd, but leave it permissive for now.
2013-11-18 13:07:58 -08:00
Nick Kralevich
006260e528 Merge "Confine hostapd, but leave it permissive for now." 2013-11-18 21:05:05 +00:00
Nick Kralevich
2c8eef873e am 2b939e8c: Merge "Confine ping, but leave it permissive for now."
* commit '2b939e8cabab28db2d7e2015ecab59e1cbdbc442':
  Confine ping, but leave it permissive for now.
2013-11-18 12:03:31 -08:00
Nick Kralevich
2b939e8cab Merge "Confine ping, but leave it permissive for now." 2013-11-18 19:59:30 +00:00
Stephen Smalley
945fb56766 Confine hostapd, but leave it permissive for now.
Change-Id: I23a2c568e9fdd51c6c09c6c80a7ce9f2b5bd4966
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-18 11:25:10 -08:00
Nick Kralevich
24fb24f7ea am ae49e7a3: Merge "Confine tee, but leave it permissive for now."
* commit 'ae49e7a3691137b5276254074b2c282bcdfee523':
  Confine tee, but leave it permissive for now.
2013-11-14 11:34:11 -08:00
Nick Kralevich
ae49e7a369 Merge "Confine tee, but leave it permissive for now." 2013-11-14 19:29:27 +00:00
Nick Kralevich
678420e023 am 6ce3d60c: Merge "Confine rild, but leave it permissive for now."
* commit '6ce3d60ca39dd37f0de4bcd81620b3611cd28e14':
  Confine rild, but leave it permissive for now.
2013-11-14 08:46:49 -08:00
Stephen Smalley
67a53232ce am b1cb3205: Confine wpa_supplicant, but leave it permissive for now.
* commit 'b1cb3205cad978399fa7c9dcafed607fe5d07de6':
  Confine wpa_supplicant, but leave it permissive for now.
2013-11-14 08:46:49 -08:00
Nick Kralevich
6ce3d60ca3 Merge "Confine rild, but leave it permissive for now." 2013-11-14 16:44:24 +00:00
Stephen Smalley
dcbab907ea Confine rild, but leave it permissive for now.
Change-Id: I6df9981b2af0150c6379a0ebdbe0a8597c994f4a
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-13 16:32:22 -05:00
Stephen Smalley
72a4745919 Confine tee, but leave it permissive for now.
Change-Id: Id69b1fe80746429a550448b9168ac7e86c38aa9f
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-13 16:31:44 -05:00
Stephen Smalley
b1cb3205ca Confine wpa_supplicant, but leave it permissive for now.
Change-Id: Iaa4ed5428d1c49cb4cff3a39c48800cb108f2ac3
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-13 16:30:55 -05:00
Nick Kralevich
ace68b1e06 am 91ebcf33: netd: allow tcp_socket name_connect
* commit '91ebcf33326418ed9603e618ad193550646c3b04':
  netd: allow tcp_socket name_connect
2013-11-13 12:08:17 -08:00
Nick Kralevich
91ebcf3332 netd: allow tcp_socket name_connect
The patch in 36a5d109e6 wasn't
sufficient to address DNS over TCP. We also need to allow
name_connect.

Fixes the following denial:

<5>[   82.120746] type=1400 audit(1830030.349:5): avc:  denied  { name_connect } for  pid=1457 comm="netd" dest=53 scontext=u:r:netd:s0 tcontext=u:object_r:port:s0 tclass=tcp_socket

Public Bug: https://code.google.com/p/android/issues/detail?id=62196
Bug: 11097631

Change-Id: I688d6923b78782e2183a9d69b7e74f95d6e3f893
2013-11-13 11:32:13 -08:00
Nick Kralevich
b391269f97 am 36a5d109: netd: allow tcp connections.
* commit '36a5d109e6953c63d2a865eab4c4d021aa52250b':
  netd: allow tcp connections.
2013-11-13 09:50:23 -08:00
Nick Kralevich
36a5d109e6 netd: allow tcp connections.
DNS can use TCP connections, in addition to UDP connections.
Allow TCP connections.

Addresses the following denial:

[ 1831.586826] type=1400 audit(1384129166.563:173): avc:  denied  { create } for  pid=11406 comm="netd" scontext=u:r:netd:s0 tcontext=u:r:netd:s0 tclass=tcp_socket

Public Bug: https://code.google.com/p/android/issues/detail?id=62196
Change-Id: Ia542a9df3e466a8d409955bab6a23a524ff3d07b
Bug: 11097631
2013-11-13 06:29:29 -08:00
Stephen Smalley
868a9e26cf am 8510d31e: Rename camera_calibration_file and audio_firmware_file.
* commit '8510d31ed3b5d53c2232b7aac5f65b32d38753d0':
  Rename camera_calibration_file and audio_firmware_file.
2013-11-12 14:55:33 -08:00
Stephen Smalley
8510d31ed3 Rename camera_calibration_file and audio_firmware_file.
Use more general type names for the contents of /data/misc/camera and
/data/misc/audio.  These were the names used in our policy until 4.3
was released, at which point we switched to be consistent with AOSP.
However, the Galaxy S4 4.2.2 image, Galaxy S4 4.3 image, and
Galaxy Note 3 4.3 image all shipped with policies using _data_file names
because they were based on our older policy.  So we may as well switch
AOSP to these names.

Not sure if in fact these could be all coalesced to the new media_data_file
type for /data/misc/media introduced by
Ic374488f8b62bd4f8b3c90f30da0e8d1ed1a7343.

Options to fix already existing devices, which would only apply
to Nexus devices with 4.3 or 4.4 at this point:
1) Add restorecon_recursive /data/misc/audio /data/misc/camera to either
the system/core init.rc or to the device-specific init.*.rc files.
-or-
2) Add a typealias declaration in the policy to remap the old type names.
to the new ones.  Then existing types on persistent storage will be
remapped internally to the new ones.
-or-
3) Some sort of relabeld.

Option #2 is implemented by this change.

Change-Id: Id36203f5bb66b5200efc1205630b5b260ef97496
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-12 17:01:44 -05:00
Nick Kralevich
bc4484b2c2 am bc1388d3: Merge "Make kernel / init enforcing"
* commit 'bc1388d34cae1cdd71284b38066a287f969a4b52':
  Make kernel / init enforcing
2013-11-12 09:32:52 -08:00
Nick Kralevich
14f95109b7 am 56f39193: Merge "Confine debuggerd, but leave it permissive for now."
* commit '56f391930142d02c66852e5cd4ebf7d83b65f80d':
  Confine debuggerd, but leave it permissive for now.
2013-11-12 09:32:52 -08:00
Nick Kralevich
bc1388d34c Merge "Make kernel / init enforcing" 2013-11-12 17:30:01 +00:00
Nick Kralevich
56f3919301 Merge "Confine debuggerd, but leave it permissive for now." 2013-11-12 17:28:21 +00:00
Stephen Smalley
a9ccd7dce9 am af47ebb6: Label /dev/fscklogs and allow system_server access to it.
* commit 'af47ebb67aa64d699615693bf4603ec173417175':
  Label /dev/fscklogs and allow system_server access to it.
2013-11-11 11:56:04 -08:00
Stephen Smalley
af47ebb67a Label /dev/fscklogs and allow system_server access to it.
Otherwise you get denials such as:
type=1400 audit(1383590310.430:623): avc:  denied  { getattr } for  pid=1629 comm="Thread-78" path="/dev/fscklogs/log" dev="tmpfs" ino=1642 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=file
type=1400 audit(1383590310.430:624): avc:  denied  { open } for  pid=1629 comm="Thread-78" name="log" dev="tmpfs" ino=1642 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=file
type=1400 audit(1383590310.430:625): avc:  denied  { write } for  pid=1629 comm="Thread-78" name="fscklogs" dev="tmpfs" ino=1628 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=dir
type=1400 audit(1383590310.430:625): avc:  denied  { remove_name } for  pid=1629 comm="Thread-78" name="log" dev="tmpfs" ino=1642 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=dir
type=1400 audit(1383590310.430:625): avc:  denied  { unlink } for  pid=1629 comm="Thread-78" name="log" dev="tmpfs" ino=1642 scontext=u:r:system_server:s0 tcontext=u:object_r:device:s0 tclass=file

Change-Id: Ia7ae06a6d4cc5d2a59b8b85a5fb93cc31074fd37
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-11 11:52:24 -08:00
Nick Kralevich
c1468d454e am 00739e3d: Make the ueventd domain enforcing.
* commit '00739e3d14f2f1ea9240037283c3edd836d2aa2f':
  Make the ueventd domain enforcing.
2013-11-11 08:40:13 -08:00
Nick Kralevich
b1d81645b3 Make kernel / init enforcing
Start running in enforcing mode for kernel / init.
This should be mostly a no-op, as the kernel / init
is in the unconfined domain.

Change-Id: I8273d936c9a4eecb50b78ae93490a4dd52f59eb6
2013-11-08 15:44:30 -08:00
Nick Kralevich
00739e3d14 Make the ueventd domain enforcing.
All (known) denials have been addressed.

Change-Id: Ic12ed190a2efb7f20be589137a27b95d03dde25a
2013-11-08 08:34:46 -08:00
Stephen Smalley
b53788de98 am a7716718: Label /data/misc/media and allow mediaserver access to it.
* commit 'a771671877d306804dbbf5a8e6baa03c877f890d':
  Label /data/misc/media and allow mediaserver access to it.
2013-11-07 16:27:03 -08:00
Stephen Smalley
a771671877 Label /data/misc/media and allow mediaserver access to it.
Otherwise we get denials like these on 4.4:

type=1400 audit(1383590170.360:29): avc:  denied  { write } for  pid=61 comm="mediaserver" name="media" dev="mtdblock1" ino=6416 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
type=1400 audit(1383590170.360:29): avc:  denied  { add_name } for  pid=61 comm="mediaserver" name="emulator.camera.hotplug.0" scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir
type=1400 audit(1383590170.360:29): avc:  denied  { create } for  pid=61 comm="mediaserver" name="emulator.camera.hotplug.0" scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
type=1400 audit(1383590170.360:29): avc:  denied  { write open } for  pid=61 comm="mediaserver" name="emulator.camera.hotplug.0" dev="mtdblock1" ino=6431 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
type=1400 audit(1383590255.100:231): avc:  denied  { write } for  pid=832 comm="mediaserver" name="emulator.camera.hotplug.0" dev="mtdblock1" ino=6431 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file
type=1400 audit(1383590255.100:231): avc:  denied  { open } for  pid=832 comm="mediaserver" name="emulator.camera.hotplug.0" dev="mtdblock1" ino=6431 scontext=u:r:mediaserver:s0 tcontext=u:object_r:system_data_file:s0 tclass=file

Change-Id: Ic374488f8b62bd4f8b3c90f30da0e8d1ed1a7343
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-07 16:22:50 -08:00
Geremy Condra
eac6e59020 am ddf98fa8: Neverallow access to the kmem device from userspace.
* commit 'ddf98fa8cf11000f91329945abc23ee791adfe69':
  Neverallow access to the kmem device from userspace.
2013-11-07 16:20:39 -08:00
Geremy Condra
ddf98fa8cf Neverallow access to the kmem device from userspace.
Change-Id: If26baa947ff462f5bb09b75918a4130097de5ef4
2013-11-07 16:17:32 -08:00
Nick Kralevich
7bc576d5d3 am 0ea4ac8a: Merge "Move goldfish-specific rules to their own directory."
* commit '0ea4ac8a12efa2f847625917f35b5cbedec3853a':
  Move goldfish-specific rules to their own directory.
2013-11-07 15:18:36 -08:00
Nick Kralevich
0ea4ac8a12 Merge "Move goldfish-specific rules to their own directory." 2013-11-07 23:16:50 +00:00
Nick Kralevich
289fe68b3e am 842a1111: Merge "Confine healthd, but leave it permissive for now."
* commit '842a1111c0544f7f855b0cdc4cceee8a370af759':
  Confine healthd, but leave it permissive for now.
2013-11-07 14:18:39 -08:00
Nick Kralevich
842a1111c0 Merge "Confine healthd, but leave it permissive for now." 2013-11-07 22:15:35 +00:00
Nick Kralevich
6b754790b5 am fec3c5ad: Merge "Make the keystore domain enforcing."
* commit 'fec3c5ad80cb5323ab7b6b808faca032c3973fc5':
  Make the keystore domain enforcing.
2013-11-07 13:40:21 -08:00
Nick Kralevich
fec3c5ad80 Merge "Make the keystore domain enforcing." 2013-11-07 21:37:09 +00:00
Elliott Hughes
1e38a55501 am aaac2468: /system/bin/ash and /system/bin/mksh are dead.
* commit 'aaac24688ee623a19525f25fe1fc81b60197f6f5':
  /system/bin/ash and /system/bin/mksh are dead.
2013-11-07 09:01:20 -08:00
Elliott Hughes
aaac24688e /system/bin/ash and /system/bin/mksh are dead.
Long live /system/bin/sh!

Change-Id: I5af63c1bdc3585835ee273ed9995d8fac14792da
2013-11-07 08:36:16 -08:00
Stephen Smalley
2a604adf1b Confine healthd, but leave it permissive for now.
Remove unconfined_domain() and add the allow rules required for
operation of healthd.  Restore the permissive declaration until
I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2 is applied to the 3.4
kernel.

Resolves the following denials in 4.4:
type=1400 audit(1383590167.750:14): avc:  denied  { read } for  pid=49 comm="healthd" path="/sbin/healthd" dev="rootfs" ino=1232 scontext=u:r:healthd:s0 tcontext=u:object_r:rootfs:s0 tclass=file
type=1400 audit(1383590167.750:15): avc:  denied  { mknod } for  pid=49 comm="healthd" capability=27  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
type=1400 audit(1383590167.750:16): avc:  denied  { create } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
type=1400 audit(1383590167.750:17): avc:  denied  { setopt } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
type=1400 audit(1383590167.750:17): avc:  denied  { net_admin } for  pid=49 comm="healthd" capability=12  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability
type=1400 audit(1383590167.750:18): avc:  denied  { bind } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
shell@generic:/ $ type=1400 audit(1383590168.800:21): avc:  denied  { call } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:servicemanager:s0 tclass=binder
type=1400 audit(1383590168.800:22): avc:  denied  { transfer } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:servicemanager:s0 tclass=binder
type=1400 audit(1383590168.800:23): avc:  denied  { 0x10 } for  pid=49 comm="healthd" capability=36  scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=capability2
type=1400 audit(1383590168.800:24): avc:  denied  { read } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:healthd:s0 tclass=netlink_kobject_uevent_socket
type=1400 audit(1383590212.320:161): avc:  denied  { call } for  pid=376 comm="system_server" scontext=u:r:system_server:s0 tcontext=u:r:healthd:s0 tclass=binder
type=1400 audit(1383590212.320:161): avc:  denied  { transfer } for  pid=376 comm="system_server" scontext=u:r:system_server:s0 tcontext=u:r:healthd:s0 tclass=binder
type=1400 audit(1383590212.320:162): avc:  denied  { call } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:system_server:s0 tclass=binder
type=1400 audit(1383590275.930:463): avc:  denied  { call } for  pid=49 comm="healthd" scontext=u:r:healthd:s0 tcontext=u:r:system_server:s0 tclass=binder

Change-Id: Iacd058edfa1e913a8f24ce8937d2d76c928d6740
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-07 09:23:12 -05:00
Nick Kralevich
a74edc1522 am f232f25b: Merge "Move audio_firmware_file and /data/misc/audio entry to core sepolicy."
* commit 'f232f25b0b1fe736a713239963aa0fae1835f0e5':
  Move audio_firmware_file and /data/misc/audio entry to core sepolicy.
2013-11-06 16:02:07 -08:00
Nick Kralevich
f232f25b0b Merge "Move audio_firmware_file and /data/misc/audio entry to core sepolicy." 2013-11-06 23:58:34 +00:00
Stephen Smalley
870c4e5e77 Make the keystore domain enforcing.
Change-Id: I7ef479ac1806b0a52bb0145a82d6d4265edc1f3e
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Bug: 11518274
2013-11-06 15:40:19 -08:00
Nick Kralevich
ca056dce95 am 2d8dcb73: Revert "Make the keystore domain enforcing."
* commit '2d8dcb732cc6e5f54fe3b3bb57a81c287c419e93':
  Revert "Make the keystore domain enforcing."
2013-11-06 12:58:20 -08:00
Stephen Smalley
a7c8ea864e Move audio_firmware_file and /data/misc/audio entry to core sepolicy.
Change-Id:  Ib8c96ab9e19d34e8e34a4c859528345763be4906
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-06 13:00:52 -05:00
Stephen Smalley
2e0b4a149e Move goldfish-specific rules to their own directory.
Change-Id:  I1bdd80f641db05fef4714654515c1e1fbb259794
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-11-06 10:27:19 -05:00
Nick Kralevich
2d8dcb732c Revert "Make the keystore domain enforcing."
This is causing runtime restarts on flo/deb when uninstalling
some APKs. Revert while I investigate it.

11-04 21:52:41.487   687   704 I ActivityManager: Force stopping com.android.development appid=10078 user=-1: uninstall pkg
11-04 21:52:41.487   687   712 W PackageManager: Couldn't delete native library directory /data/app-lib/com.android.development
11-04 21:52:41.557   687   712 W dalvikvm: threadid=20: thread exiting with uncaught exception (group=0x959dfae8)
11-04 21:52:41.557   687   712 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: PackageManager
11-04 21:52:41.557   687   712 E AndroidRuntime: java.lang.NullPointerException
11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.security.KeyStore.clearUid(KeyStore.java:327)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.removeKeystoreDataIfNeeded(PackageManagerService.java:9787)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.removePackageDataLI(PackageManagerService.java:9384)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.deleteInstalledPackageLI(PackageManagerService.java:9503)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.deletePackageLI(PackageManagerService.java:9612)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.deletePackageX(PackageManagerService.java:9239)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService.access$4100(PackageManagerService.java:178)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at com.android.server.pm.PackageManagerService$7.run(PackageManagerService.java:9173)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:733)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:136)
11-04 21:52:41.557   687   712 E AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:61)
11-04 21:52:41.567   687   712 I Process : Sending signal. PID: 687 SIG: 9

and

[    7.324554] type=1400 audit(1383601030.823:5): avc:  denied  { read write } for  pid=192 comm="keystore" name="qseecom" dev="tmpfs" ino=7521 scontext=u:r:keystore:s0 tcontext=u:object_r:device:s0 tclass=chr_file

This reverts commit 709d71836d.

Bug: 11518274
2013-11-05 09:57:40 -08:00
Nick Kralevich
3cedab4018 am 7316b18a: README: recommend concatenation vs assignment
* commit '7316b18a6c8706635592d2c60c40a505b4654312':
  README: recommend concatenation vs assignment
2013-11-04 09:48:45 -08:00
Nick Kralevich
7316b18a6c README: recommend concatenation vs assignment
Recommend using concatenation versus assignment when making
policy declarations inside BoardConfig.mk. This will allow
sepolicy to exist in the vendor directory.

Change-Id: If982217fcb3645d9c6b37a341755b5b65f26fc5f
2013-11-01 16:23:15 -07:00