Commit Graph

43 Commits

Author SHA1 Message Date
Max Bires
0c479addf2 Added audioserver.te and some allow rules and perfd_socket type
Added allow rules for the following denials:
denied { call } for pid=2460 comm="AudioOut_D"
scontext=u:r:audioserver:s0 tcontext=u:r:bootanim:s0 tclass=binder

denied { write } for pid=1464 comm="writer" name="perfd" dev="tmpfs"
ino=11825 scontext=u:r:audioserver:s0
tcontext=u:object_r:socket_device:s0 tclass=sock_file

Bug: 34784662
Test: The above denials are no longer seen in the selinux logs
Change-Id: I4dc7c054d14e8a06d42167194cf211e0822bb3a9
2017-02-15 09:02:32 -08:00
Max Bires
d1c7c88427 Adding rild.te and associated allows for bootup denials
Allows address following denials:
denied { add_name } for pid=1407 comm="rild" name="rild_ims0"
scontext=u:r:rild:s0 tcontext=u:object_r:qmuxd_socket:s0 tclass=dir

denied { write } for pid=1445 comm="rild" name="netmgr_connect_socket"
dev="tmpfs" ino=25017
scontext=u:r:rild:s0tcontext=u:object_r:socket_device:s0
tclass=sock_file

denied { connectto } for pid=1445 comm="rild"
path="/dev/socket/netmgr/netmgr_connect_socket" scontext=u:r:rild:s0
tcontext=u:r:netmgrd:s0tclass=unix_stream_socket

denied { create } for pid=1406 comm="rild" name="rild_ims0"
scontext=u:r:rild:s0 tcontext=u:object_r:qmuxd_socket:s0
tclass=sock_file

denied { write } for pid=1406 comm="rild" name="qmux_radio"
dev="tmpfs"ino=21385 scontext=u:r:rild:s0
tcontext=u:object_r:qmuxd_socket:s0 tclass=dir

denied { create } for pid=1367 comm="rild" name="rild_ims0"
scontext=u:r:rild:s0 tcontext=u:object_r:qmuxd_socket:s0
tclass=sock_file

Bug: 34784662
Test: The above denials are no longer present
Change-Id: I72766073640c620cc74a02f3578d5fda2d0133ab
2017-02-14 13:36:12 -08:00
TreeHugger Robot
b814cceb3e Merge "Added some allows to netmgrd.te" 2017-02-10 23:55:42 +00:00
TreeHugger Robot
33c25b5ff9 Merge "Adding cameraserver.te and appropriate camera_prop" 2017-02-10 23:29:19 +00:00
TreeHugger Robot
559b0b3dff Merge "Added sdd_block_device so tee could access what was a generic blk_file" 2017-02-10 22:52:47 +00:00
Max Bires
f432d5d39b Added some allows to netmgrd.te
Added allows to address the following denials. More to follow.

denied { ioctl } for pid=747 comm="netmgrd" path="socket:[27886]"
dev="sockfs" ino=27886 ioctlcmd=8946 scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=udp_socket

denied { ioctl } for pid=1295 comm="ifconfig" path="socket:[27883]"
dev="sockfs" ino=27883 ioctlcmd=8914 scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=udp_socket

denied { ioctl } for pid=747 comm="netmgrd" path="socket:[27292]"
dev="sockfs" ino=27292 ioctlcmd=89f8 scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=udp_socket

denied { ioctl } for pid=747 comm="netmgrd" path="socket:[27290]"
dev="sockfs" ino=27290 ioctlcmd=89f2 scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=udp_socket

denied { ioctl } for pid=747 comm="netmgrd" path="socket:[27868]"
dev="sockfs" ino=27868 ioctlcmd=89fd scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=udp_socket

denied { getattr } for pid=1295 comm="ifconfig"
path="/system/bin/toybox" dev="sda20" ino=509 scontext=u:r:netmgrd:s0
tcontext=u:object_r:toolbox_exec:s0 tclass=file

denied { execute_no_trans } for pid=1295 comm="netmgrd"
path="/system/bin/toybox" dev="sda20" ino=509 scontext=u:r:netmgrd:s0
tcontext=u:object_r:toolbox_exec:s0 tclass=file

denied { read open } for pid=1295 comm="netmgrd"
path="/system/bin/toybox" dev="sda20" ino=509 scontext=u:r:netmgrd:s0
tcontext=u:object_r:toolbox_exec:s0 tclass=file

denied { execute } for pid=1295 comm="netmgrd" name="toybox" dev="sda20"
ino=509 scontext=u:r:netmgrd:s0 tcontext=u:object_r:toolbox_exec:s0
tclass=file

denied { read } for pid=1293 comm="netmgrd" scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=socket

denied { write } for pid=747 comm="netmgrd" scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=socket

denied { create } for pid=747 comm="netmgrd" scontext=u:r:netmgrd:s0
tcontext=u:r:netmgrd:s0 tclass=socket

Bug: 34784662
Test: The above denials are no longer present during boot
Change-Id: I7b32552f96f2ee1cb79d8e4415823992d2d957da
2017-02-10 14:40:13 -08:00
Max Bires
19d80ab29a Adding cameraserver.te and appropriate camera_prop
Clearing up all the following denials for cameraserver during boot:

denied { ioctl } for pid=732 comm="cameraserver" path="/dev/kgsl-3d0"
dev="tmpfs" ino=20140 ioctlcmd=945 scontext=u:r:cameraserver:s0
tcontext=u:object_r:gpu_device:s0 tclass=chr_file

denied { read write } for pid=732 comm="cameraserver"
path="/dev/kgsl-3d0" dev="tmpfs" ino=20140 scontext=u:r:cameraserver:s0
tcontext=u:object_r:gpu_device:s0 tclass=chr_file

denied { open } for pid=732 comm="cameraserver" path="/dev/kgsl-3d0"
dev="tmpfs" ino=20140 scontext=u:r:cameraserver:s0
tcontext=u:object_r:gpu_device:s0 tclass=chr_file

denied { write } for pid=732 comm="cameraserver" name="property_service"
dev="tmpfs" ino=20580 scontext=u:r:cameraserver:s0
tcontext=u:object_r:property_socket:s0 tclass=sock_file

denied { connectto } for pid=732 comm="cameraserver"
path="/dev/socket/property_service" scontext=u:r:cameraserver:s0
tcontext=u:r:init:s0 tclass=unix_stream_socket

denied { set } for property=persist.camera.debug.logfile pid=753
uid=1047 gid=1005 scontext=u:r:cameraserver:s0
tcontext=u:object_r:default_prop:s0 tclass=property_service

Bug: 34784662
Test: The above denials are no longer present during bootup
Change-Id: I50945ad3fcea74554c767c867e603f80e18f115e
2017-02-10 14:09:20 -08:00
TreeHugger Robot
b1cede296a Merge "Added thermal engine allow rule and defined sysfs_thermal files" 2017-02-10 22:08:43 +00:00
Max Bires
6b49f17b55 Added sdd_block_device so tee could access what was a generic blk_file
tee was attempting to access an sdd device as per the following denial,
but access to generic block devices can't be granted due to a neverallow
rule. The device was granted its own type and tee was granted the
appropriate allow rules

avc: denied { getattr read write } for pid=790 comm="qseecomd"
name="sdd2" dev="tmpfs" ino=18294 scontext=u:r:tee:s0
tcontext=u:object_r:block_device:s0 tclass=blk_file

Bug: 34784662
Test: The above denials are no longer present
Change-Id: Idebb7c7aa5c2001f643f4d617eaa3ee8cab8ad28
2017-02-10 13:33:11 -08:00
TreeHugger Robot
0b7c49f33a Merge "Added dontaudit to surfaceflinger for firmware file dir search" 2017-02-10 19:56:39 +00:00
TreeHugger Robot
e81ff5b975 Merge "Added location allow rules and corresponding file contexts" 2017-02-10 19:08:08 +00:00
Max Bires
a6bcc8d98b Added dontaudit to surfaceflinger for firmware file dir search
This behavior is the result of a bug detailed here:
https://buganizer.corp.google.com/issues/29072816#comment52

Bug: 34784662
Test: The surfaceflinger search denial is no longer present during
bootup

Change-Id: I6ae41e953a21b988cdf303db2b059f59dcc711a5
2017-02-10 10:44:36 -08:00
Max Bires
e242bd566e Added location allow rules and corresponding file contexts
Added allow rules to cover the following bootup denials:

denied { create } for pid=1192 comm="lowi-server"
scontext=u:r:location:s0 tcontext=u:r:location:s0
tclass=netlink_route_socket

denied { bind } for pid=1192 comm="lowi-server" scontext=u:r:location:s0
tcontext=u:r:location:s0 tclass=netlink_route_socket

denied { create } for pid=1179 comm="lowi-server"
scontext=u:r:location:s0 tcontext=u:r:location:s0 tclass=udp_socket

denied { ioctl } for pid=1179 comm="lowi-server" path="socket:[23752]"
dev="sockfs" ino=23752 ioctlcmd=8913 scontext=u:r:location:s0
tcontext=u:r:location:s0 tclass=udp_sock

denied { open } for pid=1179 comm="lowi-server"
path="/sys/devices/soc/soc:qcom,ipa_fws@1e08000/subsys0/name"
dev="sysfs" ino=32744 scontext=u:r:location:s0
tcontext=u:object_r:sysfs:s0 tclass=file

denied { read } for pid=1179 comm="lowi-server" name="name" dev="sysfs"
ino=32744 scontext=u:r:location:s0 tcontext=u:object_r:sysfs:s0
tclass=file

denied { getattr } for pid=1179 comm="lowi-server"
path="/proc/1179/net/psched" dev="proc" ino=4026532035
scontext=u:r:location:s0 tcontext=u:object_r:proc_net:s0 tclass=file

denied { setuid } for pid=1179 comm="loc_launcher" capability=7
scontext=u:r:location:s0 tcontext=u:r:location:s0 tclass=capability

denied { net_admin } for pid=1225 comm="lowi-server" capability=12
scontext=u:r:location:s0 tcontext=u:r:location:s0 tclass=capability

denied { open } for pid=1225 comm="lowi-server"
path="/proc/1225/net/psched" dev="proc" ino=4026532035
scontext=u:r:location:s0 tcontext=u:object_r:proc_net:s0 tclass=file

denied { setgid } for pid=1235 comm="loc_launcher" capability=6
scontext=u:r:location:s0 tcontext=u:r:location:s0 tclass=capability

Bug: 34784662
Test: The above denials are no longer seen during boot
Change-Id: I34438e4862622aa5fc89c668fd395c1dd4a1456a
2017-02-10 09:58:01 -08:00
Max Bires
26aecc3452 Added thermal engine allow rule and defined sysfs_thermal files
Added the allow and relevant sysfs_thermal specifications to handle the
following bootup denials:

denied { read write } for pid=795 comm="thermal-engine"
name="trip_point_1_temp" dev="sysfs" ino=43298
scontext=u:r:thermal-engine:s0 tcontext=u:object_r:sysfs_thermal:s0
tclass=file

denied { ioctl write } for pid=761 comm="thermal-engine" path="socket:[18584]"
dev="sockfs" ino=18584 ioctlcmd=c302 scontext=u:r:thermal-engine:s0
tcontext=u:r:thermal-engine:s0 tclass=socket

denied { read } for pid=729 comm="thermal-engine" name="thermal_zone11"
dev="sysfs" ino=43236 scontext=u:r:thermal-engine:s0
tcontext=u:object_r:sysfs_thermal:s0 tclass=dir

denied { search } for pid=783 comm="thermal-engine" name="thermal"
dev="sysfs" ino=42709 scontext=u:r:thermal-engine:s0
tcontext=u:object_r:sysfs_thermal:s0 tclass=dir

Bug: 34784662
Test: The above denials no longer appear during boot
Change-Id: If6fd93e10a85968a16b1266d148b0303ac0e09dd
2017-02-09 23:07:08 +00:00
Max Bires
fcaa05bcab Adding system_server.te / file_contexts to handle some boot denials.
Allow rules added to address the following denials:

denied { ioctl } for pid=3488 comm="system-server-i"
path="socket:[56767]" dev="sockfs" ino=56767 ioctlcmd=c304
scontext=u:r:system_server:s0 tcontext=u:r:system_server:s0
tclass=socket

denied { open read } for pid=3488 comm="system-server-i"
path="/persist/sensors/sensors_settings" dev="sdd3" ino=17
scontext=u:r:system_server:s0 tcontext=u:object_r:persist_file:s0
tclass=file

Bug: 34784662
Test: The above denials don't appear during bootup
Change-Id: Iadc31855906dedb0adaaaed6e483122c3e175567
2017-02-09 14:52:34 -08:00
Max Bires
83d2188a36 Merge "Adding allows to init.te and kernel.te to address boot logs." 2017-02-08 04:47:39 +00:00
Max Bires
82558694a0 Merge "Added bootanim.te to add an extra allow rule for muskie" 2017-02-08 04:46:27 +00:00
Max Bires
8aea191b9b Added bootanim.te to add an extra allow rule for muskie
Added allow rule to make binder call to hwservicemanager due to denial
on call appearing in boot logs.

avc: denied { call } for pid=682 comm="BootAnimation"
scontext=u:r:bootanim:s0 tcontext=u:r:hwservicemanager:s0 tclass=binder

Bug: 34784662
Test: The call denials are no longer seen on bootup
Change-Id: I5a2976989c60f6d4fb92af1167bc6b545cd81e65
2017-02-07 20:41:31 -08:00
Max Bires
5e5f8eff28 Added sensors_device file context for /dev/sensors.
Addressed following denial on generic device that needed to be
relabeled:
avc: denied { ioctl } for pid=711 comm="sensors.qcom"
path="/dev/sensors" dev="tmpfs" ino=22661 ioctlcmd=6403
scontext=u:r:sensors:s0 tcontext=u:object_r:device:s0 tclass=chr_file

Bug: 34784662
Test: Above denial no longer present in bootup logs
Change-Id: I2738a90422fc0cd5075414b0bdc466535aecde82
2017-02-07 16:26:26 -08:00
Max Bires
c60743aef5 Adding allows to init.te and kernel.te to address boot logs.
Allows take care of following denials:
denied { create } for pid=6 comm="kworker/u16:0"
scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=socket

denied  { mounton } for  pid=1 comm="init" path="/persist" dev="sda20"
ino=44 scontext=u:r:init:s0 tcontext=u:object_r:persist_file:s0
tclass=dir

Bug: 34784662
Test: The above denials no longer appear in bootup logs
Change-Id: I1a0db919938e4d56d60e07dad65db064a5f38d45
2017-02-07 14:56:31 -08:00
Max Bires
4e84fa0008 Adding sg_device and allow rules to tee.te
There was a generic character file device that needed to be given its
own device type. Accordingly to the following denial, tee was given
several permissions to access this type

avc: denied { ioctl write setattr read } for pid=733 comm="qseecomd"
name="sg2" dev="tmpfs" ino=21736 scontext=u:r:tee:s0
tcontext=u:object_r:sg_device:s0 tclass=chr_file

According to the following denial type, tee was also given access actions
relating to tee capabilities

avc: denied { sys_admin } for pid=733 comm="qseecomd" capability=21
scontext=u:r:tee:s0 tcontext=u:r:tee:s0 tclass=capability

Bug: 34784662
Test: The above denials no longer appear in bootup logs
Change-Id: I26a63655597191da566f1ed1e290c6572abb0476
2017-02-07 12:59:04 -08:00
TreeHugger Robot
ba8687dbdd Merge "Fixed up sepolicy to handle per_mgr.te and per_proxy.te" 2017-02-07 05:44:50 +00:00
Max Bires
e15c33e473 Fixed up sepolicy to handle per_mgr.te and per_proxy.te
Starting off by adding in allow rules for per_mgr, it was clear that
per_proxy was lumped in as a per_mgr_exec class, though looking at
marlin it was shown that the two had been separated. In keeping with
convention, per_proxy was also split out into its own class and .te
file. This policy change was motivated by the following sedenials on
per_mgr

avc: denied { read } for pid=625 comm="pm-service"
scontext=u:r:per_mgr:s0 tcontext=u:r:per_mgr:s0 tclass=socket

avc: denied { transfer } for pid=654 comm="pm-proxy"
scontext=u:r:per_mgr:s0 tcontext=u:r:per_mgr:s0 tclass=binder

avc: denied { read } for pid=654 comm="pm-proxy" name="name" dev="sysfs"
ino=32744 scontext=u:r:per_mgr:s0 tcontext=u:object_r:sysfs:s0
tclass=file

avc: denied { read } for pid=623 comm="Binder:604_1" name="subsys_modem"
dev="tmpfs" ino=20191 scontext=u:r:per_mgr:s0
tcontext=u:object_r:ssr_device:s0 tclass=chr_file

avc: denied { open } for pid=623 comm="Binder:604_1"
path="/dev/subsys_modem" dev="tmpfs" ino=20191 scontext=u:r:per_mgr:s0
tcontext=u:object_r:ssr_device:s0 tclass=chr_file

Bug: 34784662
Test: The above denials are cleaned up in the boot logs
Change-Id: I4929c870f860c2e0fa7ea1d7412f960923fea602
2017-02-06 20:29:18 -08:00
Max Bires
a1ccbaca2a Adding tee.te to create allow rules for denials seen in bootup.
The allow rules added are in response to the following types of denials.

avc: denied { getattr search } for pid=732 comm="qseecomd"
path="/dev/block/platform/soc/1da4000.ufshc" dev="tmpfs" ino=19964
scontext=u:r:tee:s0 tcontext=u:object_r:block_device:s0 tclass=dir

avc: denied { read open } for pid=721 comm="qseecomd" name="/"
dev="tmpfs" ino=21664 scontext=u:r:tee:s0 tcontext=u:object_r:device:s0
tclass=dir

Further restrictions will require labeling more device nodes, otherwise
they will conflict with a neverallow restricting access to generic
device character files, so this commit should cover some of the most
basic denials, but will be expanded upon.

Bug: 34784662
Test: The denials mentioned are no longer seen
Change-Id: I3f25d7b301c86fc69e10934b50fe1093ddac7019
2017-02-06 18:45:52 -08:00
David Lin
0cc2da2fed muskie: touchscreen driver now loaded as kernel module
Install the touch driver kernel modules to muskie vendor image and
insert them once filesystem is ready. Also enable insmod sepolicy for
init process.

Bug: 32574003
Change-Id: I2ad9969816e5ebd98b53d07bd3b55c533b8997b2
Signed-off-by: David Lin <dtwlin@google.com>
2017-02-06 00:32:01 +00:00
TreeHugger Robot
61ca054372 Merge "Added surfaceflinger.te and domain.te to expand policy coverage." 2017-02-04 00:24:17 +00:00
Max Bires
6f4943b5be Added surfaceflinger.te and domain.te to expand policy coverage.
Added access to diag_device for userdebug/eng builds in
domain.te under the expectation that a good number of other types might
need it as access. Also added access to search persist_file directories
in surfaceflinger.te to address selinux denials.

Bug: 34784662
Test: surfaceflinger search denials absent from boot logs
Change-Id: I5546f6204bbe4ce2cbd26b9a9269aa9bb33d9508
2017-02-03 15:26:39 -08:00
Max Bires
9e183b6cbe Adding files for management of service_contexts.
Allowed per_mgr access to per_mgr_service and defined per_mgr_service.

Bug: 34784662
Test: per_mgr search denials no longer appear in SELinux denials
Change-Id: Ia561870b613fdd85c94d51c5b2dcaf0632ec6e24
2017-02-03 14:21:44 -08:00
Max Bires
78d994b6e2 Added individual permissive lines to each daemon.
Bug: 34784662
Test: It compiles
Change-Id: I4db2f4964a276d43209616db1fd24ef14a09db79
2017-02-03 13:06:59 -08:00
Siqi Lin
4715eb4fc3 sepolicy: Add sepolicy and file_context for ramdump
Bug: 32876521
Change-Id: I95c5aee042f91c8d9cdc864fa7c84cfb13fe1bd9
2017-01-27 15:18:05 -08:00
Thierry Strudel
403053c320 Fix hard coded path to vendor binaries
Fixes sepolicy labeling and capabilities now that vendor is not part of system
image anymore.

Change-Id: Ic1529990b18779bddeeffeb4cd69b6cdfb84a62b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-01-04 19:23:08 -08:00
Woody Lin
5e11bcd846 Bring-up A/B slot feature + vendor partition
1. Enable BUILD_SYSTEM_ROOT_IMAGE
2. generate isolated vendor.img
3. Mount modem,system,vendor with flag "slotselect" in fstab

Change-Id: I15de3e075394db72860cb6606984e6e43e3b579c
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2017-01-04 16:08:52 -08:00
Thierry Strudel
439755f3b1 init: start qti service
Bug: 32925272
Change-Id: I99a72c60a6dac1b286835dc85e8ee3b1ca8ca3fd
2016-11-30 00:29:08 -08:00
Thierry Strudel
cfd53b26d0 init: start pd-mapper service
Bug:33156943
Change-Id: I97768e2c61eb6c92c073c71a8454cc11a7afa752
2016-11-29 03:09:01 -08:00
Thierry Strudel
c9d1d305f6 enable GPS
Bug: 32638326
Change-Id: Ia29405b93b9616a84bf68d3417124824dc50cbb1
2016-11-15 16:17:09 -08:00
Thierry Strudel
979484cfdf sepolicy/file_contexts: fix init.radio.sh
Change-Id: I1e9feb9a4bc6a54ad1f2fe2eba58a5d41801ccbe
2016-11-07 15:29:01 -08:00
Thierry Strudel
83a4667ec5 muskie: enable BT
Change-Id: I633a7b050941a34e1dc131cdd9f18f6444b2644e
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2016-11-07 15:28:24 -08:00
Thierry Strudel
7f962956d6 start netmgrd and port-bridge services
Bug: 32403553
Change-Id: Icd36234940eba732097dfb5d4cd252c094b845be
2016-10-25 16:14:47 -07:00
Kumar Anand
35e3b66142 wlan: enable wifi
Change-Id: I017e369c9d2a98ae3e4acef612c4e85b5f8e4521
2016-10-21 14:25:54 -07:00
Thierry Strudel
34d5d53d9f Add qmi and radio related services
Change-Id: I8835f9e70959994667835f5626710ffd1bb81f77
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2016-10-14 17:20:25 -07:00
Thierry Strudel
1210d4249b Enable sensors and related qcom services
Bug: 31420007
Change-Id: Ie38e42aba2f241c19c3d9d895bc6e076cafca223
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2016-09-28 10:01:04 -07:00
Thierry Strudel
052abf50da Fix fb0/idle_time access error message
Change-Id: I77e3a0402be07328b2b8e554bbcf777be5edde67
2016-09-19 13:15:10 -07:00
Thierry Strudel
61c9045e7d Add perf and power init + services
Bug: 31420007
Change-Id: I7637c9cc6071730195dc174872d960bc43173552
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2016-09-15 16:42:54 -07:00