Commit graph

11350 commits

Author SHA1 Message Date
Jeff Vander Stoep
407e9457b2 domain_deprecated: remove tmpfs dir access am: ca5bb3371d
am: 453f4a51c6

Change-Id: Iff9292a4a92fdd78eebdf2ec5fab8d571fc755f6
2017-07-06 16:43:10 +00:00
Jeff Vander Stoep
453f4a51c6 domain_deprecated: remove tmpfs dir access
am: ca5bb3371d

Change-Id: I185d127216ee72821c64daf31601fdcbe1a9c069
2017-07-06 16:41:20 +00:00
Jeff Vander Stoep
ca5bb3371d domain_deprecated: remove tmpfs dir access
Address "granted" audit messages for dumpstate use of df.

avc: granted { getattr } for comm="df" path="/mnt" dev="tmpfs"
scontext=u:r:dumpstate:s0 tcontext=u:object_r:tmpfs:s0
tclass=dir
avc: granted { search } for comm="df" name="/" dev="tmpfs"
scontext=u:r:dumpstate:s0 tcontext=u:object_r:tmpfs:s0
tclass=dir

Bug: 28760354
Test: Build, check logs.
Change-Id: I920948a5f0bce1b4bd2f15779730df8b3b1fea5a
2017-07-05 22:44:21 -07:00
Nick Kralevich
aa33afc90d resolve merge conflicts of a92d3135 to stage-aosp-master
am: b748e652e9

Change-Id: I4cd3587232e426b2684c77a7cb548b006f6f8647
2017-07-03 07:20:17 +00:00
Nick Kralevich
b748e652e9 resolve merge conflicts of a92d3135 to stage-aosp-master
Test: Policy compiles.
Change-Id: Iaa19c64f6b54423dbfa5ae16d288501ab0e64cbc
2017-07-02 22:26:12 -07:00
Treehugger Robot
a92d313561 Merge "recovery: clean up audit logspam" 2017-07-03 03:55:41 +00:00
Jeff Sharkey
6433a09c3b Merge "Allow installd to delete files via sdcardfs." am: a6f6295cdb
am: b41291f57e

Change-Id: I8e1151461bdd5a47cc81a9be744a8918bb61560a
2017-07-03 03:09:30 +00:00
Jeff Sharkey
b41291f57e Merge "Allow installd to delete files via sdcardfs."
am: a6f6295cdb

Change-Id: I0c54b62288aa73842a9f0dc8fa0f9a5c8e64bc98
2017-07-03 03:06:31 +00:00
Treehugger Robot
a6f6295cdb Merge "Allow installd to delete files via sdcardfs." 2017-07-03 03:02:15 +00:00
Jeffrey Vander Stoep
739f75987b Merge "Add SEPolicy for new Java-based Broadcast Radio service." am: 6466092f18
am: f44267a5a8

Change-Id: Iea0f7ef8960d89d19451b7a47dc1852155dd3af9
2017-07-03 02:49:41 +00:00
Jeff Vander Stoep
c8338f2669 domain_deprecated: remove ion access am: 88e4be54a6
am: 8745ac4363

Change-Id: I6816eea55ad110d7aeea43ec3088452b38b7ccc7
2017-07-03 02:49:29 +00:00
Jeff Vander Stoep
9bbe420b42 recovery: clean up audit logspam
avc: granted { search } scontext=u:r:recovery:s0 tcontext=u:object_r:cache_file:s0 tclass=dir
avc: granted { getattr } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
avc: granted { read } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
avc: granted { read open } scontext=u:r:recovery:s0 tcontext=u:object_r:rootfs:s0 tclass=file
avc: granted { read } scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs:s0 tclass=file
avc: granted { read open } scontext=u:r:recovery:s0 tcontext=u:object_r:sysfs:s0 tclass=file
avc: granted { search } scontext=u:r:recovery:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir

Fixes: 62619253
Test: policy builds, no more "granted" messages in dmesg for recovery.
Merged-In: I3f6d8ceee80307a01a8fd40cb4f8362a9825b1a3
Change-Id: I3f6d8ceee80307a01a8fd40cb4f8362a9825b1a3
(cherry picked from commit ea1d6e7dc2)
2017-07-03 02:47:49 +00:00
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 Sharkey
dd57e69886 Allow installd to delete files via sdcardfs.
When installd clears cached files on external storage, the sdcardfs
kernel filesystem needs to be kept in the loop to release any cached
dentries that it's holding onto.  (Otherwise the underlying disk
space isn't actually released.)

installd can already delete the underlying files directly (via the
media_rw_data_file rules), so this technically isn't expanding its
capabilities.

avc: granted { search } for name="/" dev="tmpfs" ino=6897 scontext=u:r:installd:s0 tcontext=u:object_r:tmpfs:s0 tclass=dir
avc: denied { open } for path="/mnt/runtime/default/emulated/0/Android/data" dev="sdcardfs" ino=589830 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=1
avc: denied { write } for name="com.google.android.inputmethod.japanese" dev="sdcardfs" ino=590040 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0
avc: denied { remove_name } for name="cache_r.m" dev="sdcardfs" ino=589868 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=dir permissive=0
avc: denied { getattr } for path="/mnt/runtime/default/emulated/0/Android/data/.nomedia" dev="sdcardfs" ino=589831 scontext=u:r:installd:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=1

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.StorageHostTest
Bug: 37486230
Change-Id: Icfd00a9ba379b1f50c48fe85849304cf9859bcb2
(cherry picked from commit 72f4c61979)
2017-07-03 00:34:26 +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
685db0b279 Remove more domain_deprecated permissions am: e39d5c875e
am: 9ce812fbe0

Change-Id: Ie71e8eb97e3ace63a230fcd70b81961d1a8f4884
2017-07-01 14:38:56 +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
3ce2c6f866 Merge "Allow only system_server to read uid_time_in_state" am: 439364d20e
am: e96aad0998

Change-Id: I0742836c6b613afeab2dcf6d59c37dd9787dc91a
2017-07-01 12:59:05 +00:00
Jeff Vander Stoep
1a1cefcc96 Merge "Remove adbd tcontexts from domain_deprecated" am: 056710b38a
am: 2af7c84fac

Change-Id: Id52f1fd3e79a0a36df42abca24c93b28b277c570
2017-07-01 12:58:51 +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
2d74ecde52 dexoptanalyzer: suppress access(2) denial am: 06aee357e4
am: e8bf363d3f

Change-Id: Ic3e7a595e2878becc5ecf81631e8088f487c51e2
2017-06-30 23:52:36 +00: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
ad01d1f6ab Define smc_socket security class. am: 2be9799bcc
am: 52909aca44

Change-Id: I613dc32aac4b3276924717e8066fd2cd229b81ec
2017-06-26 22:14:20 +00:00
Stephen Smalley
021b5e9321 Merge "Define getrlimit permission for class process" am: e02e0ad1cc
am: a77096b02a

Change-Id: I2719cfbcf0e6ce58c4953602e2113bd6fe1ce0cd
2017-06-26 22:14:08 +00: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
Jeff Vander Stoep
e3c7880ef5 Add another extraneous neverallow rule to force attribute inclusion
am: c75aa50d5d

Change-Id: I91bbecf1b60944fb43022dcc5f5ffe452b713193
2017-06-26 22:00:37 +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
Jeff Vander Stoep
c75aa50d5d Add another extraneous neverallow rule to force 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: 62658302
Bug: 62999603
Test: Build Marlin policy.
Test: verify attribute exists in policy using sepolicy-analyze.
    sepolicy-analyze $OUT/vendor/etc/selinux/precompiled_sepolicy \
    attribute hal_tetheroffload_server
Test: CTS neverallow tests pass.
    cts-tradefed run cts -m CtsSecurityHostTestCases -t \
    android.cts.security.SELinuxNeverallowRulesTest
Change-Id: I62596ba8198ffdcbb4315df639a834e4becaf249
2017-06-26 10:32:18 -07: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