Commit graph

7835 commits

Author SHA1 Message Date
Nick Kralevich
d9bd9e69fc Add directory read permissions to certain domains.
am: 49e3588429

Change-Id: Ib96dbc7f6467e55d595426242c59b9551e9ae75f
2016-11-28 17:12:36 +00:00
Nick Kralevich
49e3588429 Add directory read permissions to certain domains.
Addresses the following denials and auditallows:

avc: denied { read } for pid=561 comm="hwservicemanage" name="hw"
dev="dm-0" ino=1883 scontext=u:r:hwservicemanager:s0
tcontext=u:object_r:system_file:s0 tclass=dir permissive=0

avc: denied { read } for pid=748 comm="gatekeeperd" name="hw" dev="dm-0"
ino=1883 scontext=u:r:gatekeeperd:s0 tcontext=u:object_r:system_file:s0
tclass=dir permissive=0

avc: granted { read open } for pid=735 comm="fingerprintd"
path="/system/lib64/hw" dev="dm-0" ino=1883 scontext=u:r:fingerprintd:s0
tcontext=u:object_r:system_file:s0 tclass=dir

Test: no denials on boot
Change-Id: Ic363497e3ae5078e564d7195f3739a654860a32f
2016-11-28 17:03:41 +00:00
Nick Kralevich
3f77c683da Merge "system_server: Delete system_file:file execute_no_trans;"
am: 8fe7b8d2a7

Change-Id: I904920227113f9b8e43182a4b3ba22b191cceb64
2016-11-28 16:58:43 +00:00
Nick Kralevich
97aff6aefc Merge "Remove domain_deprecated from some domains."
am: 2affae65dc

Change-Id: I9f5c692674c60b526b0ed7ac2bc46610b9e3c5ab
2016-11-28 16:58:33 +00:00
Nick Kralevich
f42128af64 Merge "Delete more from domain_deprecated.te"
am: fae2794e44

Change-Id: Iba87329c6ae3de6ad95868a9237eec83fd76da05
2016-11-28 16:58:22 +00:00
Treehugger Robot
8fe7b8d2a7 Merge "system_server: Delete system_file:file execute_no_trans;" 2016-11-28 16:55:09 +00:00
Treehugger Robot
2affae65dc Merge "Remove domain_deprecated from some domains." 2016-11-28 16:52:21 +00:00
Treehugger Robot
fae2794e44 Merge "Delete more from domain_deprecated.te" 2016-11-28 16:51:25 +00:00
Nick Kralevich
067bdcfb61 Merge "Remove "eng" macro"
am: 03e74a2026

Change-Id: I168746eb6e2fded35d2da632731d4300522e0afd
2016-11-28 16:02:15 +00:00
Nick Kralevich
73ea360542 logd.te: Remove setting persist.sys. and sys.powerctl
am: 31e9f39f59

Change-Id: I763244982b9e104f3a2ef68a81609db0b5ca9f39
2016-11-28 16:02:02 +00:00
Treehugger Robot
03e74a2026 Merge "Remove "eng" macro" 2016-11-28 15:56:59 +00:00
Nick Kralevich
d070b67190 Remove "eng" macro
Never used.

Test: policy compiles.
Change-Id: I0ce6c46bb05925a4b3eda83531b28f873b0c9b99
2016-11-27 16:03:26 -08:00
Nick Kralevich
31e9f39f59 logd.te: Remove setting persist.sys. and sys.powerctl
As of system/core commit a742d1027784a54c535cff69b375a9f560893155, this
functionality is no longer used.

Test: device boots and no obvious problems.
Change-Id: Ia3ad8add92f1cdaaff36f4935be8b03458fed7f2
2016-11-27 15:34:18 -08:00
Nick Kralevich
0fa81a27a0 Remove domain_deprecated from some domains.
No denials showing up in collected audit logs.

Bug: 28760354
Test: Device boots
Test: No unexpected denials in denial collection logs.
Change-Id: I5a0d4f3c51d296bfa04e71fc226a01dcf5b5b508
2016-11-25 17:37:30 -08:00
Nick Kralevich
06da58b9ab Delete more from domain_deprecated.te
No unexpected usages.

Bug: 28760354
Test: Device boots
Test: No unexpected denials in denial collection logs.
Change-Id: I43226fd0b8103afb1b25b1eb21445c04bc79954e
2016-11-25 17:14:45 -08:00
Nick Kralevich
80659f5508 Merge "Move to ioctl whitelisting for /dev/pts/* files"
am: d1228f2e70

Change-Id: Ic825465ad7cf20ebe26cb1f0a4e6077bf3648ce9
2016-11-26 00:27:28 +00:00
Treehugger Robot
d1228f2e70 Merge "Move to ioctl whitelisting for /dev/pts/* files" 2016-11-26 00:23:49 +00:00
Nick Kralevich
55e86a3a34 system_server: Delete system_file:file execute_no_trans;
auditallow has been in place since Apr 2016
(f84b798151) and no SELinux denials have
been generated / collected. Remove unused functionality.

Test: Device boots with no problems.
Test: no SELinux denials of this type collected.
Bug: 28035297
Change-Id: I52414832abb5780a1645a4df723c6f0c758eb5e6
2016-11-25 16:20:34 -08:00
Nick Kralevich
07c3a5a522 Move to ioctl whitelisting for /dev/pts/* files
In particular, get rid of TIOCSTI, which is only ever used for exploits.

http://www.openwall.com/lists/oss-security/2016/09/26/14

Bug: 33073072
Bug: 7530569
Test: "adb shell" works
Test: "adb install package" works
Test: jackpal terminal emulator from
      https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en
      works
Change-Id: I96b5e7059d106ce57ff55ca6e458edf5a4c393bf
2016-11-22 18:59:38 -08:00
Nick Kralevich
97494e4ae0 Merge "label /bugreports"
am: e6a20295c8

Change-Id: Ib769255c5c35ffbc47cd81c9592046b0a6282379
2016-11-23 00:11:15 +00:00
Treehugger Robot
e6a20295c8 Merge "label /bugreports" 2016-11-23 00:06:30 +00:00
Tao Bao
0733c2066f Merge "recovery.te: Allow writing to sysfs_devices_system_cpu."
am: 94d76c877b

Change-Id: I3d4343c5c1bc210253e24de8aeec192e331ffebb
2016-11-22 23:57:21 +00:00
Treehugger Robot
94d76c877b Merge "recovery.te: Allow writing to sysfs_devices_system_cpu." 2016-11-22 23:48:44 +00:00
Nick Kralevich
a824fa33ca neverallow some /proc file reads
am: 0b7506ff53

Change-Id: I8093d316ef2f0e5839073b88351bca4eace75b7b
2016-11-22 23:26:07 +00:00
Tao Bao
ee7960c05d recovery.te: Allow writing to sysfs_devices_system_cpu.
recovery (update_binary) may need to set up cpufreq during an update.

avc:  denied  { write } for  pid=335 comm="update_binary" name="scaling_max_freq" dev="sysfs" ino=7410 scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs_devices_system_cpu:s0 tclass=file permissive=0

Bug: 32463933
Test: Build a recovery image and apply an OTA package that writes to
      /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq.

Change-Id: Ia90af9dd15e162dd94bcd4722b66aa296e3058c5
2016-11-22 14:03:25 -08:00
Nick Kralevich
0b7506ff53 neverallow some /proc file reads
Lock in the gains we've made so far in restricting access to generically
labeled /proc files. There's more we can do here, but let's avoid
inadvertent regressions.

Test: policy compiles. Only compile time assertions added.
Bug: 26813932
Change-Id: If354c2ddc1c59beed7f0eb4bcbd3f0d9971c3b8a
2016-11-22 13:18:02 -08:00
Nick Kralevich
d314376da9 label /bugreports
/data/bugreports is moving to /bugreports

Bug: 27262109
Bug: 27204904
Bug: 32799236
Test: new symlink is in /bugreports and is labeled correctly
Change-Id: Ib6a492fba8388bf43debad28cfc851679f8c6151
2016-11-22 08:59:08 -08:00
Nick Kralevich
1d18ef4486 access_vectors: Remove unused permission definitions
am: 11dc03e5a2

Change-Id: Ie2c7f871c47d378cc3b8399e174b229439511452
2016-11-22 01:39:56 +00:00
Nick Kralevich
11dc03e5a2 access_vectors: Remove unused permission definitions
Description stolen from
42a9699a9f

Remove unused permission definitions from SELinux.
Many of these were only ever used in pre-mainline
versions of SELinux, prior to Linux 2.6.0.  Some of them
were used in the legacy network or compat_net=1 checks
that were disabled by default in Linux 2.6.18 and
fully removed in Linux 2.6.30.

Permissions never used in mainline Linux:
file swapon
filesystem transition
tcp_socket { connectto newconn acceptfrom }
node enforce_dest
unix_stream_socket { newconn acceptfrom }

Legacy network checks, removed in 2.6.30:
socket { recv_msg send_msg }
node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }

Test: policy compiles and no boot errors (marlin)
Change-Id: Idaef2567666f80db39c3e3cee70e760e1dac73ec
2016-11-21 23:41:18 +00:00
Jorge Lucangeli Obes
2c2ee69500 Merge "Add WITH_DEXPREOPT_PIC to 'with_dexpreopt' SELinux macro."
am: f25e5550a7

Change-Id: I267d30094daf909158f720fa8e7c501e13a5ccc3
2016-11-21 23:28:38 +00:00
Treehugger Robot
f25e5550a7 Merge "Add WITH_DEXPREOPT_PIC to 'with_dexpreopt' SELinux macro." 2016-11-21 23:16:53 +00:00
Jorge Lucangeli Obes
2899434716 Add WITH_DEXPREOPT_PIC to 'with_dexpreopt' SELinux macro.
|WITH_DEXPREOPT_PIC = false| will still cause code to be loaded from
/data.

Bug: 32970029
Test: On HiKey and Marlin:
Test: Add |WITH_DEXPREOPT_PIC = false|, see SELinux denial.
Test: Apply this CL, no SELinux denials.
Change-Id: I0a1d39eeb4d7f75d84c1908b879d9ea1ccffba74
2016-11-21 11:57:08 -05:00
Nick Kralevich
b9566eff33 Collapse urandom_device into random_device
am: 5eadcb8cb1

Change-Id: I79ed60bfb69e16c0e55ff84583e0930a7adf7cb8
2016-11-21 16:41:26 +00:00
Nick Kralevich
f1f6f2ffaa domain_deprecated.te: delete stale permissions
am: f2de07529b

Change-Id: I198f91d03eb87d3fc707b67d50a9a363d94e066a
2016-11-21 16:41:15 +00:00
Nick Kralevich
5eadcb8cb1 Collapse urandom_device into random_device
urandom_device and random_device have the exact same security
properties. Collapse them into one type.

Test: device boots and /dev/urandom is labeled correctly.
Change-Id: I12da30749291bc5e37d99bc9422bb86cb58cec41
2016-11-21 16:37:07 +00:00
Nick Kralevich
f2de07529b domain_deprecated.te: delete stale permissions
auditallows have been in place for quite a while now, and nothing has
triggered. Let's do some cleanup!

Bug: 28760354
Test: device boots and no new denials
Test: SELinux denials collection has seen no instances of these
      permissions
Change-Id: I9293f8d8756c9db6307e344c32cd11b9e0183e7f
2016-11-20 08:34:02 -08:00
Daniel Micay
9ab5a2787a only permit text relocations in untrusted_app
am: dc083f596d

Change-Id: I38a2613d04dc0e59dc9e76dff39ab5ae9a024ae4
2016-11-20 15:16:55 +00:00
Daniel Micay
dc083f596d only permit text relocations in untrusted_app
The other domains either don't have the same backwards compatibility
issues (isolated_app) or are privileged components that are pretty much
part of the platform and can be expected to meet a higher standard.

It would be possible to expose a build option for disabling the ART JIT,
allowing conditional removal of execmem from some of these domains too
(ones not ever using the WebView, until that's always in isolated_app).

Bug: 20013628
Change-Id: Ic22513157fc8b958b2a3d60381be0c07b5252fa5
2016-11-20 15:10:34 +00:00
Jorge Lucangeli Obes
ff63c47d78 Merge "Use with_dexpreopt macro for zygote execute permissions."
am: 1eb00fb625

Change-Id: Iacfd0778591ebcc34f72c82d4ea4fcc3f7777ce7
2016-11-18 21:56:48 +00:00
Jorge Lucangeli Obes
1eb00fb625 Merge "Use with_dexpreopt macro for zygote execute permissions." 2016-11-18 21:52:07 +00:00
dcashman
7d25474624 Move hal_light to attribute.
am: 3319d5ee16

Change-Id: I6cd85d7fb4235cb2adb4eb0f598959cec52108d0
2016-11-18 19:29:36 +00:00
Jorge Lucangeli Obes
84db84e6cd Use with_dexpreopt macro for zygote execute permissions.
When WITH_DEXPREOPT is set, the zygote does not need to execute
dalvikcache_data_file objects.

Bug: 32970029
Test: Add policy line inside macro, build with and without WITH_DEXPREOPT.
Test: HiKey builds, boots, no zygote denials.
Change-Id: I4dace93e8044267232f0f26cfe427fc250d351fb
2016-11-18 14:22:37 -05:00
dcashman
3319d5ee16 Move hal_light to attribute.
HAL policy defines how the platform and a given HAL interact, but not how the
HAL is implemented.  This policy should be represented as an attribute that all
processes implementing the HAL can include.

Bug: 32123421
Test: Builds.
Change-Id: I17e5612c0835773c28e14f09e2ce7bdc3f210c15
2016-11-18 08:40:04 -08:00
Connor O'Brien
f142317a83 Merge "Revert "Move boot_control_hal attribute to hal_boot domain""
am: b44d2c9b7c

Change-Id: Ia43d948ce7b31336d90f188b6fb2578832be1fee
2016-11-18 04:28:34 +00:00
Treehugger Robot
b44d2c9b7c Merge "Revert "Move boot_control_hal attribute to hal_boot domain"" 2016-11-18 04:24:34 +00:00
Connor O'Brien
394ed93d90 Revert "Move boot_control_hal attribute to hal_boot domain"
This reverts commit 1f3294659d.

Bug: 32973182
Change-Id: Ic0277b38b0249710a4f1fc362e777f3880ff096b
2016-11-18 02:43:03 +00:00
Max Bires
a30f39cb58 Merge "Removed a duplicate rule."
am: 590d0e2418

Change-Id: I79e775df50badaf511d6fedc1cca60e39048b5dc
2016-11-17 23:57:38 +00:00
Max Bires
590d0e2418 Merge "Removed a duplicate rule." 2016-11-17 23:46:29 +00:00
Max
ca04f9b3c4 Removed a duplicate rule.
Test: Device boots
Change-Id: I151c5fb6f56850eaa215e1a917ac9ad609dbdd4a
2016-11-17 23:46:15 +00:00
Connor O'Brien
1dedd46d27 Merge "Move boot_control_hal attribute to hal_boot domain"
am: e1df51038e

Change-Id: I796889ba9eea3c4496ac581d5da2d383b08465ab
2016-11-17 19:32:42 +00:00