Commit graph

16543 commits

Author SHA1 Message Date
Nick Kralevich
9dcac0c594 Merge "add links to docs explaining motivations behind neverallow assertions."
am: 7826a7879c

Change-Id: I5f36f6f66d0b94486fea5baed9bf1a427e004909
2018-09-12 19:35:04 -07:00
Nick Kralevich
8e3e57af2d Merge "Link to documentation for different block device types"
am: 9ec48cef5b

Change-Id: I2bf3e6229167dd05057d7ae0805ed660655050fc
2018-09-12 19:34:28 -07:00
Treehugger Robot
7826a7879c Merge "add links to docs explaining motivations behind neverallow assertions." 2018-09-13 02:13:24 +00:00
Treehugger Robot
9ec48cef5b Merge "Link to documentation for different block device types" 2018-09-13 01:50:15 +00:00
Chong Zhang
eeb7a35673 Merge "add a property to allow thumbnailer to use hw codecs"
am: 73871c9000

Change-Id: I6ae91bff988cdaa850d4213532bc2604db87ca24
2018-09-12 17:16:28 -07:00
Nick Kralevich
40085222ca Merge "Change priv-apps /data/data labels to privapp_data_file"
am: 6a14368c16

Change-Id: I0e6c226f25cca58ca2715417a856df80e80442f8
2018-09-12 17:15:57 -07:00
Chong Zhang
73871c9000 Merge "add a property to allow thumbnailer to use hw codecs" 2018-09-13 00:04:32 +00:00
Treehugger Robot
6a14368c16 Merge "Change priv-apps /data/data labels to privapp_data_file" 2018-09-12 23:55:30 +00:00
Nick Kralevich
6cf9160e82 add links to docs explaining motivations behind neverallow assertions.
Test: comments only. Policy compiles.
Change-Id: Ic51533d37fff6c553950a122f33a48e3c119c67c
2018-09-12 15:53:48 -07:00
Steven Moreland
70dd23b749 Merge "Apply '--fake-treble' flag to the intended devices"
am: e64414ef81

Change-Id: I6c3e4c4b2df59dd24e2096d95e839baecfba46cb
2018-09-12 15:20:11 -07:00
Treehugger Robot
e64414ef81 Merge "Apply '--fake-treble' flag to the intended devices" 2018-09-12 21:04:23 +00:00
Nick Kralevich
4b26c91ae6 Link to documentation for different block device types
The number of block devices used in an Android device is too damn high
(insert meme here). Let's at least add some links to documentation to
help describe the partition layout expected on a typical Android device.

This builds on top of the work in making the bootloader information
accessible (b/28905584).

Test: only adding comments. Policy compiles.
Change-Id: I8976b855e46255f7e18fa2b807ba83e0db92a82d
2018-09-12 13:58:53 -07:00
Nick Kralevich
5d1755194a Change priv-apps /data/data labels to privapp_data_file
Currently, both untrusted apps and priv-apps use the SELinux file label
"app_data_file" for files in their /data/data directory. This is
problematic, as we really want different rules for such files. For
example, we may want to allow untrusted apps to load executable code
from priv-app directories, but disallow untrusted apps from loading
executable code from their own home directories.

Commit 23c9d91b46 introduced a new type
called privapp_data_file and added rules necessary to preserve
compatibility. However, that change did not relabel any existing files,
so effectively the change was a no-op.

This change performs the switch, relabeling priv-app's /data/data files
from app_data_file to privapp_data_file. Due to the compatibility rules
added in 23c9d91b46, there should be no
noticeable effect from this change.

This change was originally submitted as
4df57822fc. However, it was reverted in
cdc6649acc due to a different labeling
bug. That bug has been fixed, and we can reapply this change.

Test: Factory reset and boot - no problems on fresh install.
Test: Upgrade to new version and test. No compatibility problems on
      filesystem upgrade.
Bug: 112357170
2018-09-12 12:30:32 -07:00
Chong Zhang
8248d9b262 add a property to allow thumbnailer to use hw codecs
bug: 113609172
Change-Id: Ifff91630c3622661139ff27f25932258802cb082
2018-09-12 10:13:56 -07:00
Hector Dearman
94574f3715 Merge "Make system_server atrace category work with traced_probes"
am: 9e6c78f73f

Change-Id: I744ab8cbdbef8c39d3f6d7ef7c5bfc2a31475bf7
2018-09-12 07:27:49 -07:00
Hector Dearman
9e6c78f73f Merge "Make system_server atrace category work with traced_probes" 2018-09-12 14:07:07 +00:00
Martijn Coenen
ffca81393d Merge "Allow init to use binder."
am: b115341dff

Change-Id: I023a2f6bb8703b109312bac73e00706fa928989e
2018-09-12 01:48:45 -07:00
Martijn Coenen
b115341dff Merge "Allow init to use binder." 2018-09-12 08:39:50 +00:00
Torne (Richard Coles)
4222b7c3b4 Merge "Allow shared_relro to access PackageManager."
am: cb09ff080d

Change-Id: Ib78e953e654e017be8055e3f45673d8faf9df786
2018-09-11 16:22:34 -07:00
Treehugger Robot
cb09ff080d Merge "Allow shared_relro to access PackageManager." 2018-09-11 23:09:56 +00:00
Tao Bao
184e57c5c2 Whitelist minui properties to be overridden by /vendor/default.prop.
am: 703acc6acd

Change-Id: I7771d99563177ee4603e6a2b0e11931d13a0a38a
2018-09-11 14:48:17 -07:00
Tao Bao
703acc6acd Whitelist minui properties to be overridden by /vendor/default.prop.
These values will be read by platform module (/sbin/charger), and need
to be configurable by vendor init.

Bug: 113567255
Test: Build along with other CLs in the topic (for Makefile and
      libminui changes). Boot into charger mode.
Test: Boot into recovery. Run graphics test.
Change-Id: I5b272f345e2a5a255c2f660c59c1da3245aa1e03
2018-09-11 21:12:20 +00:00
Torne (Richard Coles)
0f326f3c47 Allow shared_relro to access PackageManager.
Allow the shared_relro creation process to make calls to PackageManager,
so that it can create a classloader corresponding to the current WebView
implementation. This avoids needing to pass an absolute path to the
native library to the process, which required that the calling code
duplicate existing logic in the framework to find the library and
resulted in bugs and inconsistencies.

Bug: 110790153
Test: WebView-related CTS and GTS tests
Change-Id: I9902bb0400e2a800021dac06278151c8541d458f
2018-09-11 16:26:56 -04:00
Joel Galenson
48aa3f548c Merge "Ensure taking a bugreport generates no denials."
am: dc60253988

Change-Id: I51c93e4078163807129fdefa6d108d7acc4e5a26
2018-09-11 09:48:40 -07:00
Treehugger Robot
dc60253988 Merge "Ensure taking a bugreport generates no denials." 2018-09-11 16:12:21 +00:00
Martijn Coenen
a720d3d00a Allow init to use binder.
But in a very restricted form:
1) Nobody can initiate calls into init
2) Nobody can transfer binder objects into init, except servicemanager

Bug: 112684055
Test: device boots
Change-Id: Icfb218f2871e234284c74e096eccd7a2e786cf94
2018-09-11 07:28:59 +00:00
Hridya Valsaraju
fbde815e2d Merge "Recovery does not need permission to start adbd anymore"
am: 7706f51fd3

Change-Id: I5999552df5444e90804e91dac93d9e15da0679c8
2018-09-10 18:59:15 -07:00
Treehugger Robot
7706f51fd3 Merge "Recovery does not need permission to start adbd anymore" 2018-09-11 01:49:57 +00:00
Joel Galenson
e9ee9d86d0 Ensure taking a bugreport generates no denials.
Allow dumpstate to get information about sockets and dontaudit
accessing vendor files when running df.

Bug: 112440280
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t android.security.cts.SELinuxHostTest#testNoBugreportDenials
Change-Id: Ide3cb2f3ce3f079bf30b3bd46810f9b55e105b2b
2018-09-10 15:48:34 -07:00
Benjamin Gordon
e24f2d6a2c Merge "sepolicy: Allow apps to read ashmem fds from system_server"
am: f434377515

Change-Id: I2aa6a90d0217a8471b6538b747e9ab98b3c3dcd6
2018-09-10 10:43:35 -07:00
Treehugger Robot
f434377515 Merge "sepolicy: Allow apps to read ashmem fds from system_server" 2018-09-10 17:33:20 +00:00
Benjamin Gordon
360559e7bb sepolicy: Allow apps to read ashmem fds from system_server
Kernel commit 8a2af06415ef0fc922162503dd18da0d9be7771f (ashmem: switch
to ->read_iter) switched ashmem from using __vfs_read to vfs_iter_read
to read the backing shmem file.  Prior to this, reading from an ashmem
fd that was passed between processes didn't hit any permission checks;
now SELinux checks that the receiver can read from the creator's file
context.

Some apps receive buffers through ashmem from system_server, e.g., the
settings app reads battery stats from system_server through ashmem when
an app details page is opened.  Restore this ability by giving apps read
access to system_server_tmpfs.  system_server is still responsible for
creating and passing across the ashmem buffers, so this doesn't give
apps the ability to read anything system_server isn't willing to give
them.

Bug: 112987536
Bug: 111381531
Test: atest android.appsecurity.cts.PermissionsHostTest on kernel 4.14
Change-Id: Ice5e25f55bc409e91ad7e8c7ea8b28ae213191a3
2018-09-10 17:04:09 +00:00
Hector Dearman
244bc7cf97 Make system_server atrace category work with traced_probes
Historically most uses of atrace happen via the shell domain.

There are two exceptions:
- boot tracing
- traced_probes

We need to get feature parity, so atrace has the same behavior
when is invoked either via shell or from its own domain (e.g.
via traced_probes that has an auto_trans rule into atrace on exec).
Atrace works by setting system properties to enable tracing from userspace
then poking all the binder services to read the system properties (see [1]) so
enabling the system_server category requires the ability to call binder
methods on the system_server.

For more use cases see b/113127224

[1]: 9ead54bed6/cmds/atrace/atrace.cpp (545)

Bug: 113127224
Test: Add an atrace category to the Perfetto config and confirm the data
shows up.

Change-Id: Id077eff960ffb1cdd7b0ce84b21ac9ef70444a4a
2018-09-10 14:03:27 +01:00
Tri Vo
15f64cacab Merge "ro.crypto.{allow_encrypt_override filenames_mode} vendor-init-settable."
am: 34e98082ff

Change-Id: I16b7b89a742fe502ce534f8ae941116fbca4eeab
2018-09-09 13:49:26 -07:00
Tri Vo
34e98082ff Merge "ro.crypto.{allow_encrypt_override filenames_mode} vendor-init-settable." 2018-09-09 20:37:09 +00:00
Tri Vo
fe72cb70d7 ro.crypto.{allow_encrypt_override filenames_mode} vendor-init-settable.
Bug: 114017832
Test: m selinux_policy
Change-Id: I1dcb09c76b3e49888d278a154d79add6c6a6c977
2018-09-08 14:42:51 -07:00
Nick Kralevich
7496d3827d Add nnp_nosuid_transition policycap and related class/perm definitions.
am: 1b1d133be5

Change-Id: I3fa539a472a0ac382205ad206fe56a36949d222c
2018-09-07 19:43:47 -07:00
Steven Moreland
c7670e5c55 Apply '--fake-treble' flag to the intended devices
(for the build-time tests)

treble_sepolicy_tests applies tests to the SEPolicy for devices which
implement the SEPolicy split introduced in Android O. For devices which
turn this on and also implement all of the other requirements which
together compose PRODUCT_FULL_TREBLE, these tests help ensure that the
backwards compatibility which this feature adds is possible.

When this test was originally written, devices which specified
PRODUCT_FULL_TREBLE_OVERRIDE were only those devices with a
PRODUCT_SHIPPING_API_LEVEL of < 26. This allowed them to update to use
these features but maintain some legacy behaviors. For these devices,
to achieve the same backwards compatibility guarantees, much
other/extra work would have to be done (if it is possible at all).

Since that time, a new category of devices take advantage of
PRODUCT_FULL_TREBLE_OVERRIDE. These devices must either not define a
PRODUCT_SHIPPING_API_LEVEL or they apply this flag even though it is
not required to be applied. For these cases, the full test suite not
being run has caused problems because these failures aren't discoverred
until later (when compliance tests are run).

Fixes: 112933807
Test: treble_sepolicy_tests on marlin, walleye, and 'some other device'
    (mma here runs this with the correct parameters)

Change-Id: I04c42d3cb86cda3c82f285919b40ba94e1332daa
2018-09-07 16:29:26 -07:00
Hridya Valsaraju
187d6e2280 Recovery does not need permission to start adbd anymore
adbd is started by an init trigger now when sys.usb.config is set
to adb.

Test: adb sideload works in user/userdebug builds
Bug: 113563995
Change-Id: I23db4074cd49cf0ba6c4eb27510e3a5caad5681b
2018-09-07 14:57:36 -07:00
Nick Kralevich
1b1d133be5 Add nnp_nosuid_transition policycap and related class/perm definitions.
af63f4193f
allows a security policy writer to determine whether transitions under
nosuid / NO_NEW_PRIVS should be allowed or not.

Define these permissions, so that they're usable to policy writers.

This change is modeled after refpolicy
1637a8b407

Test: policy compiles and device boots
Test Note: Because this requires a newer kernel, full testing on such
   kernels could not be done.
Change-Id: I9866724b3b97adfc0cdef5aaba6de0ebbfbda72f
2018-09-07 10:52:31 -07:00
Hridya Valsaraju
8386cae8ad Merge "Fastbootd does not require read access to system and boot partitions"
am: 8d7d5b42b5

Change-Id: Ib4ed24211801d21ebc45a967d37c2137185f3ad9
2018-09-07 10:19:03 -07:00
Treehugger Robot
8d7d5b42b5 Merge "Fastbootd does not require read access to system and boot partitions" 2018-09-07 17:04:38 +00:00
Jeff Vander Stoep
f066823921 Merge "Disallow new untrusted_app access to /proc/tty/drivers"
am: f82c66f240

Change-Id: Ibc7070d5716e91c66dc696a9f8d7a7dba8540213
2018-09-07 09:32:25 -07:00
Treehugger Robot
f82c66f240 Merge "Disallow new untrusted_app access to /proc/tty/drivers" 2018-09-07 16:15:57 +00:00
Jeff Vander Stoep
ff511cb5db Disallow new untrusted_app access to /proc/tty/drivers
Access is deprecated for apps with targetSdkVersion=26+.

Test: build (neverallow rules are build time assertions)
Change-Id: I36480c38d45cf6bfb75f4988ffcefefc6b62d4b1
2018-09-07 07:39:28 -07:00
Marcin Oczeretko
a98b64d44e Merge "Add looper_stats_service to SE policy."
am: fb947d0c36

Change-Id: Idde84efff4c01752fa8ca131630481d73c7ed3a3
2018-09-07 03:08:58 -07:00
Marcin Oczeretko
fb947d0c36 Merge "Add looper_stats_service to SE policy." 2018-09-07 09:51:33 +00:00
Hridya Valsaraju
e9fcce5642 Fastbootd does not require read access to system and boot partitions
Bug: 78793464
Test: fastboot flashall

Change-Id: I5b65b818dc43a01f90a38202e3a1b810fef70ca8
2018-09-07 00:09:34 +00:00
Jeff Vander Stoep
51e3bfa7f0 Merge "tombstoned: clean up TODO on anr writes"
am: bedc4f170c

Change-Id: Ief9aeb57bdad01d14cabb100bea2f101c00f1c7f
2018-09-06 16:32:03 -07:00
Nick Kralevich
d8f692043a Merge "dumpstate: remove JIT and /data execute"
am: ac45700478

Change-Id: Iafdd7cff1733d605baf2fdbd46b181fcb69d226d
2018-09-06 16:30:48 -07:00