Commit Graph

4944 Commits

Author SHA1 Message Date
shafik
55a54d3ff9 Add native flags namespace storage_native_boot
Grant SEPolicy write permissions for device_config_storage_native_boot.

Test: build and flash - device successfully boots
Bug: 140803239
Change-Id: I6e4f5889aee9384b47faacb31e2b1938250428ef
2019-10-04 11:05:48 +00:00
Inseob Kim
07c6671bc4 Merge "Add attributes for exported properties" 2019-09-20 03:01:21 +00:00
Inseob Kim
19b99f18c8 Add attributes for exported properties
This introduces some attributes that can be used to restrict access to
exported properties so that one can easily check from which the
properties can be accessed, and that OEMs can extend their own exported
properties.

Bug: 71814576
Bug: 131162102
Test: boot aosp_cf_x86_phone-userdebug
Test: logcat | grep "avc: "
Change-Id: I6f988ec1cb94fa64563ca6cb91b7702da5d604e3
2019-09-19 05:07:50 +00:00
Treehugger Robot
ff75b228ae Merge "idmap: add binderservice permissions" 2019-09-18 14:18:08 +00:00
Jeff Vander Stoep
0f00cd283e idmap: add binderservice permissions
Allow dumpsys to dump process information for bug reports.

Test: build
Test: adb bugreport
Bug: 140541614
Change-Id: Ia361e8c8de2cc5f798e746dffcf067393fd6bcae
2019-09-18 13:47:09 +02:00
Treehugger Robot
4db20c6922 Merge "neverallow init *:process noatsecure" 2019-09-17 06:08:18 +00:00
Paul Crowley
2367ba358f Allow toolbox to rm -rf /data/per_boot
Bug: 140882488
Test: create files and dirs in /data/per_boot, check they're removed.
Change-Id: Idf0ba09cbe51cbff6a7b2a464c4651a1f7fcf343
2019-09-16 10:18:57 -07:00
Nick Kralevich
a1458c64d3 neverallow init *:process noatsecure
The use of sensitive environment variables, such as LD_PRELOAD, is disallowed
when init is executing other binaries. The use of LD_PRELOAD for init spawned
services is generally considered a no-no, as it injects libraries which the
binary was not expecting. This is especially problematic for APEXes. The use
of LD_PRELOAD via APEXes is a layering violation, and inappropriately loads
code into a process which wasn't expecting that code, with potentially
unexpected side effects.

Test: compiles
Bug: 140789528
Change-Id: Ia781ec7318e700cddfd52df97c504b771f413504
2019-09-16 09:50:32 -07:00
Steven Thomas
726150eda4 Merge "Allow access to the "refresh_rate_switching" system property" 2019-09-13 00:55:33 +00:00
Tom Cherry
2176375a8a Merge "ueventd: allow using external firmware handlers" 2019-09-12 22:52:37 +00:00
Steven Thomas
f98c3902c2 Allow access to the "refresh_rate_switching" system property
Bug: 136592946
Bug: 138261472

Test: Ran with the patch applied, confirmed surface flinger can access
the system property.

Change-Id: I259a488399c5e698de384322852ea81ea1a96e7d
Merged-In: I259a488399c5e698de384322852ea81ea1a96e7d
2019-09-11 18:30:50 -07:00
Treehugger Robot
535d297a5f Merge "Root of /data belongs to init (re-landing)" 2019-09-10 04:14:17 +00:00
Treehugger Robot
4cacfc3bdf Merge "domain.te: remove /proc/sys/vm/overcommit_memory read access" 2019-09-10 00:29:37 +00:00
Treehugger Robot
aa31e64e83 Merge "Access to HALs from untrusted apps is blacklist-based" 2019-09-10 00:22:07 +00:00
Paul Crowley
aed0f76ee9 Root of /data belongs to init (re-landing)
Give /data itself a different label to its contents, to ensure that
only init creates files and directories there.

This change originally landed as aosp/1106014 and was reverted in
aosp/1116238 to fix b/140402208. aosp/1116298 fixes the underlying
problem, and with that we can re-land this change.

Bug: 139190159
Bug: 140402208
Test: aosp boots, logs look good
Change-Id: I1a366c577a0fff307ca366a6844231bcf8afe3bf
2019-09-09 14:42:01 -07:00
Nick Kralevich
003e858205 domain.te: remove /proc/sys/vm/overcommit_memory read access
Remove everyone's ability to read /proc/sys/vm/overcommit_memory.
Android's jemalloc implementation no longer uses this file.

init.te had multiple rules which allowed writing to this file. Get rid of
the duplicate rule.

Bug: 140736217
Test: compiles and boots
Test: bypass setup wizard and start the browser, browse the web
Change-Id: I5a2d5f450f5dde5dd55a0cedd7fbd55a6ac0beed
2019-09-09 13:39:28 -07:00
Mathieu Chartier
6e85cd91d0 Merge "Remove ability to set profilebootimage and profilesystemserver" 2019-09-09 20:08:33 +00:00
Mathieu Chartier
3079462443 Remove ability to set profilebootimage and profilesystemserver
These properties should no longer be specified in the vendor rom.

Bug: 139883463
Test: manual

(cherry picked from commit 1f6eda4111)

Exempt-From-Owner-Approval: Cherry-pick from master
Merged-In: I510c917fa3c60dcbd3f104ebe619f34c69c821e6
Change-Id: I8b7cf03d7a2faceb03b83edcb47e831fbc8c8918
2019-09-09 19:49:10 +00:00
Treehugger Robot
9aa263055b Merge "Revert "Root of /data belongs to init"" 2019-09-06 23:13:48 +00:00
Paul Crowley
d98e311952 Revert "Root of /data belongs to init"
This reverts commit 206b6535f1.

Reason for revert: Droidfood is blocked
Bug: 140402208
Change-Id: I1d1eb014747ba5c5bb656342e53b8c4e434878d1
2019-09-06 19:59:17 +00:00
Martin Stjernholm
53f223346d Merge "Rename the context for the ART APEX." 2019-09-06 14:37:16 +00:00
Jiyong Park
e95c704b6f Access to HALs from untrusted apps is blacklist-based
Before this change, access to HALs from untrusted apps was prohibited
except for the whitelisted ones like the gralloc HAL, the renderscript
HAL, etc. As a result, any HAL that is added by partners can't be
accessed from apps. This sometimes is a big restriction for them when
they want to access their own HALs in the same-process HALs running in
apps. Although this is a vendor-to-vendor communication and thus is not
a Treble violation, that was not allowed because their HALs are not in
the whitelist in AOSP.

This change fixes the problem by doing the access control in the
opposite way; access to HALs are restricted only for the blacklisted
ones.

All the hwservice context that were not in the whitelist are now put
to blacklist.

This change also removes the neverallow rule for the binder access to
the halserverdomain types. This is not needed as the protected
hwservices living in the HAL processes are already not accessible; we
have a neverallow rule for preventing hwservice_manager from finding
those protected hwservices from untrusted apps.

Bug: 139645938
Test: m

Merged-In: I1e63c11143f56217eeec05e2288ae7c91e5fe585
(cherry picked from commit 580375c923)

Change-Id: I4e611091a315ca90e3c181f77dd6a5f61d3a6468
2019-09-06 14:10:38 +09:00
Treehugger Robot
cd1d6deaa5 Merge "neverallow_macros: add watch* perms" 2019-09-05 19:43:19 +00:00
Martin Stjernholm
d7951d2647 Rename the context for the ART APEX.
Test: Boot (with default flattened APEXes)
Bug: 135753770
Change-Id: I551e88a250d3bd891f63a6bccee0682d0d0de7cf
2019-09-05 19:49:05 +01:00
Nick Kralevich
6a7a72b07a neverallow_macros: add watch* perms
In cases where directory read access has been neverallowed via
no_rw_dir_perms, also neverallow the various watch* permissions.
If read was disallowed by the neverallow assertions, there's an
assumption that watch was also intended to not be allowed. Make that
assumption explicit.

References:
* https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ac5656d8a4cdd93cd2c74355ed12e5617817e0e7
* c4ab8edf74
* dddbaaf1e8

Test: compiles
Change-Id: I8139eaf1165a5090c7b48e45f353170e58ddf1d9
2019-09-05 09:54:43 -07:00
Paul Crowley
e9465fceb6 Merge "Root of /data belongs to init"
am: b935b6c664

Change-Id: I39a36ec663c98ac55be886e886da4afbf34e9cf2
2019-08-29 23:10:42 -07:00
Paul Crowley
206b6535f1 Root of /data belongs to init
Give /data itself a different label to its contents, to ensure that
only init creates files and directories there.

Bug: 139190159
Test: aosp boots, logs look good
Change-Id: I3ee654a928bdab3f5d435ab6ac24040d9bdd9abe
2019-08-29 15:08:21 -07:00
Steven Moreland
b27a746f50 Merge "Remove vintf_service."
am: cacefc6a78

Change-Id: Id30138a0955dc7883d83daa2b655a06efebcaaf7
2019-08-28 19:15:40 -07:00
Treehugger Robot
cacefc6a78 Merge "Remove vintf_service." 2019-08-29 01:58:04 +00:00
Nick Kralevich
3ddd22a6f3 Merge "global_macros: trim back various watch* permissions"
am: 91e7562efd

Change-Id: Ia607147d662a7f92192fff7f369b9c439c2adc3e
2019-08-28 17:47:12 -07:00
Treehugger Robot
91e7562efd Merge "global_macros: trim back various watch* permissions" 2019-08-28 23:58:18 +00:00
Paul Crowley
1fc44958bd Merge "Move layout_version to /data/misc/installd"
am: 7f9c607b4f

Change-Id: I05c2ba0b7f2f44c72bb6c6eba16a4ab385c15939
2019-08-28 13:35:17 -07:00
Steven Moreland
ebc39c37ab Merge "Clarify vendor_service/vintf_service."
am: 961bf003d6

Change-Id: Ibe65d802dff7d54ed1886800568840e0434dd696
2019-08-28 13:27:44 -07:00
Paul Crowley
7f9c607b4f Merge "Move layout_version to /data/misc/installd" 2019-08-28 19:56:15 +00:00
Nick Kralevich
c4ab8edf74 global_macros: trim back various watch* permissions
Commit dddbaaf1e8 ("update sepolicy
for fs notification hooks") updated global macros, and added
watch, watch_mount, watch_sb, watch_with_perm, and watch_reads
to r_file_perms and r_dir_perms.

In retrospect, the commit was overly permissive and some of the
permissions shouldn't be granted by default. In particular:

1) watch_with_perm: This is only used with fanotify and requires
CAP_SYS_ADMIN. fanotify has limited use cases, including virus scanning
and hierarchical storage management. Granting this by default makes it
harder to audit and understand this powerful capability. In particular,
anti-virus file like monitoring is something which inherently conflicts
with Android app privacy guarantees and would need to be carefully
reviewed.

2) watch_mount & watch_sb: Setting a watch on a mount (FAN_MARK_MOUNT)
or superblock (FAN_MARK_FILESYSTEM) should be extremely unusual.
Granting this by default makes it harder to audit and understand.

Both "watch" and "watch_reads" are retained for now.

References:
* https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ac5656d8a4cdd93cd2c74355ed12e5617817e0e7
* dddbaaf1e8

Test: compiles
Change-Id: Ib74e7119853eb991e0e9828645c7f9e076b919c4
2019-08-28 12:36:58 -07:00
Steven Moreland
4bb0a9802a Remove vintf_service.
The only distinction that matters for security is if a service is
served by vendor or not AND which process is allowed to talk to which.

coredomain is allowed to talk to vintf_service OR vendor_service, it's
just that for a non-@VintfStability service user-defined APIs (as
opposed to pingBinder/dump) are restricted.

Bug: 136027762
Test: N/A
Change-Id: If3b047d65ed65e9ee7f9dc69a21b7e23813a7789
2019-08-28 11:32:25 -07:00
Steven Moreland
961bf003d6 Merge "Clarify vendor_service/vintf_service." 2019-08-28 17:50:41 +00:00
Nick Kralevich
c057561d79 Merge "update sepolicy for fs notification hooks"
am: 7981b230b0

Change-Id: I8f4deb640eb058176342ae71918e2e5b4e8633c3
2019-08-28 03:59:45 -07:00
Treehugger Robot
7981b230b0 Merge "update sepolicy for fs notification hooks" 2019-08-28 10:41:40 +00:00
Steven Moreland
c73b9bbbe0 Merge "System service neverallow, make full_treble_only."
am: 517d7f0db6

Change-Id: I9c0b00384b88dfc11315acea13072d431877b64e
2019-08-27 18:38:35 -07:00
Steven Moreland
517d7f0db6 Merge "System service neverallow, make full_treble_only." 2019-08-28 01:15:21 +00:00
Steven Moreland
df0a65785c Clarify vendor_service/vintf_service.
These attributes are intended to be used w/ services using the system
copy of libbinder (for vendor, this is libbinder_ndk).

Switching vndservicemanager users using the libbinder copy of vendor to
be able to use the system copy of libbinder for registration is an open
problem.

Bug: 136027762
Test: N/A
Change-Id: I1d70380edcb39ca8ef2cb98c25617701b67ba7e1
2019-08-27 15:37:11 -07:00
Zim
7cfc15c68c Merge "Allow remounting /mnt/user/0 as slave mount"
am: 83b28e267e

Change-Id: Ibf8c5c37b8c56fa6c2775b4a591c31ebef6e4dd2
2019-08-27 15:34:10 -07:00
Nick Kralevich
dddbaaf1e8 update sepolicy for fs notification hooks
Update access_vectors and global_macros to account for the changes in
kernel commit
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ac5656d8a4cdd93cd2c74355ed12e5617817e0e7

This change is needed to allow Android to boot on linux-next

Test: compiles
Change-Id: I35c59fc50fa9c94ab94399ce74d637e49d38129d
2019-08-27 15:31:59 -07:00
Treehugger Robot
83b28e267e Merge "Allow remounting /mnt/user/0 as slave mount" 2019-08-27 22:03:00 +00:00
Steven Moreland
25871e7f2f System service neverallow, make full_treble_only.
Since non-full-Treble devices aren't guaranteed to have coredomain
applied to all system processes, this is breaking some downstream
non-Treble devices.

Bug: 140076135
Test: N/A
Change-Id: I2942506cb0cfd8096c631281389a16aa48b4da08
2019-08-27 10:47:11 -07:00
Paul Lawrence
31e6fa2075 Merge "Fix ext4/metadata/udc problem"
am: 4d40aefa4b

Change-Id: I6d445070b533d3353a714fb043102c0be00cc883
2019-08-27 08:44:48 -07:00
Paul Lawrence
4d40aefa4b Merge "Fix ext4/metadata/udc problem" 2019-08-27 15:21:58 +00:00
Treehugger Robot
c7b1be7d4c Merge "Remove mediacodec_service." 2019-08-26 21:32:47 +00:00
Steven Moreland
2092764024 Merge "Remove mediacodec_service." into stage-aosp-master 2019-08-23 17:33:44 +00:00