Commit graph

11329 commits

Author SHA1 Message Date
Jeffrey Vander Stoep
f44267a5a8 Merge "Add SEPolicy for new Java-based Broadcast Radio service."
am: 6466092f18

Change-Id: I856e01d9d06978dfcaf13fff078430cefbc7a9eb
2017-07-03 02:46:45 +00:00
Jeff Vander Stoep
8745ac4363 domain_deprecated: remove ion access
am: 88e4be54a6

Change-Id: I064f2becfde44f300ddf9d36802972b35c54e152
2017-07-03 02:46:30 +00:00
Jeffrey Vander Stoep
6466092f18 Merge "Add SEPolicy for new Java-based Broadcast Radio service." 2017-07-03 02:41:22 +00:00
Jeff Vander Stoep
88e4be54a6 domain_deprecated: remove ion access
Logs show that only dumpstate requires access.

avc: granted { read open } for comm="screencap" path="/dev/ion"
dev="tmpfs" ino=14324 scontext=u:r:dumpstate:s0
tcontext=u:object_r:ion_device:s0 tclass=chr_file
avc: granted { ioctl } for comm="screencap" path="/dev/ion" dev="tmpfs"
ino=14324 ioctlcmd=4906 scontext=u:r:dumpstate:s0
tcontext=u:object_r:ion_device:s0 tclass=chr_file

Grant ion permission to dumpstate which uses it for screencap
feature.

Bug: 28760354
Test: build. Check logs.
Change-Id: I6435b7dbf7656669dac5dcfb205cf0aeda93991b
2017-07-03 00:12:55 +00:00
Jeff Vander Stoep
9ce812fbe0 Remove more domain_deprecated permissions
am: e39d5c875e

Change-Id: Ibdb49f80b11fca40f5c4de7a92780be26b3280eb
2017-07-01 14:33:56 +00:00
Andres Oportus
e96aad0998 Merge "Allow only system_server to read uid_time_in_state"
am: 439364d20e

Change-Id: I726672b2e3379e2e53d3c6b26482147f11d06d8e
2017-07-01 12:54:07 +00:00
Jeff Vander Stoep
2af7c84fac Merge "Remove adbd tcontexts from domain_deprecated"
am: 056710b38a

Change-Id: Id44e16b03b1b5398bb4fd73bc4950e5da8acd5b7
2017-07-01 12:53:51 +00:00
Jeff Vander Stoep
e39d5c875e Remove more domain_deprecated permissions
Logs indicate no usage of these permissions.

Bug: 28760354
Test: check logs.
Change-Id: I3d75aea6afd4e326f705274ab2790e5d0bbdb367
2017-07-01 12:49:22 +00:00
Treehugger Robot
439364d20e Merge "Allow only system_server to read uid_time_in_state" 2017-07-01 12:48:41 +00:00
Treehugger Robot
056710b38a Merge "Remove adbd tcontexts from domain_deprecated" 2017-07-01 12:47:40 +00:00
Jeff Vander Stoep
4d5721a5a3 Remove adbd tcontexts from domain_deprecated
Logs indicate apps, system_server, and runas are the only
domains that require this permission.

Bug: 28760354
Test: check logs.
Change-Id: I93dc53ec2d892bb91c0cd6f5d7e9cbf76b9bcd9f
2017-07-01 06:30:58 +00:00
Andres Oportus
97b955de13 Allow only system_server to read uid_time_in_state
Bug: 62706738
Bug: 34133340
Test: Check that uid_time_in_state can't be read from
the shell without root permissions and that
"dumpsys batterystats --checkin| grep ctf" shows frequency
data (system_server was able to read uid_time_in_state)

Change-Id: Ic6a54da4ebcc9e10b0e3af8f14a45d7408e8686e
(cherry picked from commit 4dc88795d0)
2017-06-30 22:07:57 -07:00
Tomasz Wasilczyk
53bc8bf360 Add SEPolicy for new Java-based Broadcast Radio service.
Bug: b/36863239
Test: manual
Change-Id: I7e929926efbb1570ea9723ef3810a511c71dc11a
(cherry picked from commit 38f0928fb0)
2017-06-30 21:38:32 -07:00
Jeff Vander Stoep
e8bf363d3f dexoptanalyzer: suppress access(2) denial
am: 06aee357e4

Change-Id: Ib49585b7e3a39969ebc23113c2b3ccdb04602cb5
2017-06-30 23:48:06 +00:00
Jeff Vander Stoep
06aee357e4 dexoptanalyzer: suppress access(2) denial
A legitimate call to access(2) is generating a denial. Use the
audit_access permission to suppress the denial on just the access()
call.

avc: denied { write } for name="verified_jars"
scontext=u:r:dexoptanalyzer:s0
tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir

Bug: 62597207
Test: build policy
Test: The following cmd succeeds but no longer generates a denial
    adb shell cmd package compile -r bg-dexopt --secondary-dex \
    com.google.android.googlequicksearchbox

Change-Id: I7d03df2754c24c039bce11426bf8f317232f5e5f
(cherry picked from commit 575e627081)
2017-06-30 15:30:06 -07:00
Stephen Smalley
52909aca44 Define smc_socket security class.
am: 2be9799bcc

Change-Id: If42bc0d3fc50db8294c8a9fd083d915b8e47a95e
2017-06-26 22:02:28 +00:00
Stephen Smalley
a77096b02a Merge "Define getrlimit permission for class process"
am: e02e0ad1cc

Change-Id: I67eea67d667005d5ac357e1131a319ed57b33894
2017-06-26 22:02:12 +00:00
Stephen Smalley
2be9799bcc Define smc_socket security class.
Linux kernel commit da69a5306ab9 ("selinux: support distinctions among all
network address families") triggers a build error if a new address family
is added without defining a corresponding SELinux security class.  As a
result, the smc_socket class was added to the kernel to resolve a build
failure as part of merge commit 3051bf36c25d that introduced AF_SMC circa
Linux 4.11.  Define this security class and its access vector, add
it to the socket_class_set macro, and exclude it from webview_zygote
like other socket classes.

Test:  Policy builds

Change-Id: Idbb8139bb09c6d1c47f1a76bd10f4ce1e9d939cb
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-06-26 21:44:58 +00:00
Treehugger Robot
e02e0ad1cc Merge "Define getrlimit permission for class process" 2017-06-26 21:40:18 +00:00
Daniel Rosenberg
4e65fed1bf Merge "Add rules for vfat for sdcardfs" am: b9bba83abc
am: f26d79c561

Change-Id: I0c1a79082955faeebe8cf70bb408928479117aad
2017-06-22 21:11:45 +00:00
Daniel Rosenberg
f26d79c561 Merge "Add rules for vfat for sdcardfs"
am: b9bba83abc

Change-Id: I2fb029b770d53bacbe8dd11a69cee5e70b6ef2e9
2017-06-22 21:07:44 +00:00
Treehugger Robot
b9bba83abc Merge "Add rules for vfat for sdcardfs" 2017-06-22 21:01:25 +00:00
Tomonori Nanbu
9d86e622e3 Merge "Add sepolicy for hal_wifi to access /proc/modules" am: 6acd70b918
am: ded0b58d62

Change-Id: I574e60486bb12214e33a8e9aabf7794d4ebc0b1a
2017-06-22 15:45:20 +00:00
Tomonori Nanbu
ded0b58d62 Merge "Add sepolicy for hal_wifi to access /proc/modules"
am: 6acd70b918

Change-Id: Ia4a4ffdf43cb1641785e18f9aad7ca96b5d45ab9
2017-06-22 15:41:23 +00:00
Treehugger Robot
6acd70b918 Merge "Add sepolicy for hal_wifi to access /proc/modules" 2017-06-22 15:35:14 +00:00
Sandeep Patil
65ffb0657f Merge "Revert "Annotate rild with socket_between_core_and_vendor_violators"" into oc-dev
am: 0e0ed156ea

Change-Id: Ic73d84dacc95d5b902dc6c9530b98e53d71574f1
2017-06-22 00:37:47 +00:00
TreeHugger Robot
0e0ed156ea Merge "Revert "Annotate rild with socket_between_core_and_vendor_violators"" into oc-dev 2017-06-22 00:35:08 +00:00
Daniel Rosenberg
8a65aeca0e Add rules for vfat for sdcardfs
This adds parellel rules to the ones added for media_rw_data_file
to allow apps to access vfat under sdcardfs. This should be reverted
if sdcardfs is modified to alter the secontext it used for access to
the lower filesystem

Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65
Bug: 62584229
Test: Run android.appsecurity.cts.ExternalStorageHostTest with
      an external card formated as vfat
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2017-06-22 00:20:59 +00:00
Jeff Vander Stoep
319d70993d Merge "Exempt tetheroffload hal from network socket restrictions" into oc-dev
am: 6351c374c2

Change-Id: I16cbe7b654532367829a0df2dcfa929c38e547fd
2017-06-21 23:31:12 +00:00
TreeHugger Robot
6351c374c2 Merge "Exempt tetheroffload hal from network socket restrictions" into oc-dev 2017-06-21 23:26:22 +00:00
Sandeep Patil
3a9391152f Revert "Annotate rild with socket_between_core_and_vendor_violators"
This reverts commit 57e9946fb7.

Bug: 62616897
Test: choosecombo 1 aosp_arm64_ab userdebug; m -j 80 The build should
    not break.

Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-06-21 15:30:56 -07:00
Dan Cashman
317c4171d2 Remove neverallow preventing hwservice access for apps.
am: 3e307a4de5

Change-Id: I90e567c8138fa75bf792af181890d0af627b6f48
2017-06-21 21:37:32 +00:00
Jeff Vander Stoep
d75a2c0cc8 Exempt tetheroffload hal from network socket restrictions
The tetheroffload hal must be able to use network sockets as part of
its job.

Bug: 62870833
Test: neverallow-only change builds.
Change-Id: I630b36340796a5ecb5db08e732b0978dd82835c7
2017-06-21 12:46:21 -07:00
Dan Cashman
3e307a4de5 Remove neverallow preventing hwservice access for apps.
Same-process HALs are forbidden except for very specific HALs that have
been provided and whitelisted by AOSP.  As a result, a vendor extension
HAL may have a need to be accessed by untrusted_app.  This is still
discouraged, and the existing AOSP hwservices are still forbidden, but
remove the blanket prohibition.  Also indicate that this is temporary,
and that partners should expect to get exceptions to the rule into AOSP
in the future.

Bug: 62806062
Test: neverallow-only change builds.  Verify new attribute is in policy.
Change-Id: I6d3e659147d509a3503c2c9e0b6bb9016cc75832
2017-06-21 12:30:36 -07:00
Yabin Cui
492a53fe27 Allow run-as to read/write unix_stream_sockets created by adbd.
am: 330d447778

Change-Id: Ice6c84f53d50b7fa987ea4e7259ecda4c64673aa
2017-06-20 23:03:24 +00:00
Yabin Cui
330d447778 Allow run-as to read/write unix_stream_sockets created by adbd.
This is to Allow commands like `adb shell run-as ...`.

Bug: http://b/62358246
Test: run commands manually.
Change-Id: I7bb6c79a6e27ff1224a80c6ddeffb7f27f492bb2
(cherry picked from commit 1847a38b4a)
2017-06-20 13:50:54 -07:00
Yabin Cui
ed88246c57 Avoid audit when running adb shell -t run-as xxx. am: 3b7d9e49df
am: 6e46ccdf57

Change-Id: I5241333ec9099c7db3154cfcdb41003c65e235a0
2017-06-20 19:59:55 +00:00
Yabin Cui
6e46ccdf57 Avoid audit when running adb shell -t run-as xxx.
am: 3b7d9e49df

Change-Id: I5f12ae2d4c00efe648d1eecbe8a322de93e6447d
2017-06-20 19:56:24 +00:00
Yabin Cui
3b7d9e49df Avoid audit when running adb shell -t run-as xxx.
run-as uses file descriptor created by adbd when running
`adb shell -t run-as xxx`. It produces audit warnings like below:

[ 2036.555371] c1    509 type=1400 audit(1497910817.864:238): avc: granted { use } for pid=4945 comm="run-as" path="/dev/pts/0" dev="devpts" ino=3 scontext=u:r:runas:s0 tcontext=u:r:adbd:s0 tclass=fd

Bug: http://b/62358246
Test: test manually that the warning disappears.
Change-Id: I19023ac876e03ce2afe18982fe753b07e4c876bb
2017-06-19 16:02:07 -07:00
Daniel Rosenberg
29713c8da6 Merge "Add rules for vfat for sdcardfs" into oc-dev
am: 58d0d1e4af

Change-Id: Ia53beb365c39d501c9d6cd53a4cb72dec14b610b
2017-06-16 22:04:05 +00:00
TreeHugger Robot
58d0d1e4af Merge "Add rules for vfat for sdcardfs" into oc-dev 2017-06-16 21:53:42 +00:00
Dan Cashman
6f94efafd8 Merge "Add extraneous neverallow rule to enforce attribute inclusion." into oc-dev
am: b5aeaf6dfa

Change-Id: Ibcf17f7bbea4923abc5d1713227568bb35c6674b
2017-06-16 20:45:50 +00:00
TreeHugger Robot
b5aeaf6dfa Merge "Add extraneous neverallow rule to enforce attribute inclusion." into oc-dev 2017-06-16 20:37:52 +00:00
Daniel Rosenberg
260a4485f3 Add rules for vfat for sdcardfs
This adds parellel rules to the ones added for media_rw_data_file
to allow apps to access vfat under sdcardfs. This should be reverted
if sdcardfs is modified to alter the secontext it used for access to
the lower filesystem

Change-Id: Idb123206ed2fac3ead88b0c1ed0b66952597ac65
Bug: 62584229
Test: Run android.appsecurity.cts.ExternalStorageHostTest with
      an external card formated as vfat
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2017-06-16 19:47:33 +00:00
Dan Cashman
939b50ff61 Add extraneous neverallow rule to enforce attribute inclusion.
Due to the massively increased number of attributes in SELinux policy
as part of the treble changes, we have had to remove attributes from
policy for performance reasons.  Unfortunately, some attributes are
required to be in policy to ensure that our neverallow rules are being
properly enforced.  Usually this is not a problem, since neverallow rules
indicate that an attribute should be kept, but this is not currently the
case when the attribute is part of a negation in a group.

This is particularly problematic with treble since some attributes may
exist for HALs that have no implementation, and thus no types.  In
particular, this has caused an issue with the neverallows added in our
macros.  Add an extraneous neverallow rule to each of those auto-generated
neverallow rules to make sure that they are not removed from policy, until
the policy compiler is fixed to avoid this.  Also add corresponding rules
for other types which have been removed due to no corresponding rules.

Bug: 62591065
Bug: 62658302
Test: Attributes present in policy and CTS passes.  sepolicy-analyze also
works on platform-only policy.
Change-Id: Ic3fc034cdbd04a94167f8240cf562297e8d7c762
2017-06-16 11:19:53 -07:00
Sandeep Patil
760674da63 Merge changes from topic 'fix-neverallow-violation' into oc-dev
am: 3692b3189e

Change-Id: Ide1a5455e2b279ac1532bbdb88e852dba3ee2b28
2017-06-16 17:22:47 +00:00
Sandeep Patil
8aa283fef3 radio: disalllow radio and rild socket for treble devices
am: d3381cd9e6

Change-Id: Iaabe00cb6e919b4e35896c0d9ef1770aee3b2363
2017-06-16 17:22:42 +00:00
Sandeep Patil
3692b3189e Merge changes from topic 'fix-neverallow-violation' into oc-dev
* changes:
  build: run neverallow checks on platform sepolicy
  radio: disalllow radio and rild socket for treble devices
2017-06-16 17:14:31 +00:00
Tom Cherry
24d0cad327 Merge "Add getpgid to system_service and init" am: 2122f1fe95
am: 043068593a

Change-Id: I3eb542cced980ce94425110d8dc8e58aeb122607
2017-06-15 17:28:00 +00:00
Tom Cherry
043068593a Merge "Add getpgid to system_service and init"
am: 2122f1fe95

Change-Id: I05f0b28b9e6622477fe2fa4b041ea03c5744f82c
2017-06-15 17:23:52 +00:00