Commit graph

3528 commits

Author SHA1 Message Date
Roshan Pius
3aa1c1725e sepolicy: Permission changes for new wifi mainline module
Move wifi services out of system_server into a separate APK/process.

Changes:
a) Created sepolicy for the new wifi apk.
b) The new APK will run with network_stack uid (eventually will be moved
to the same process).

Used 'audit2allow' tool to gather list of permissions required.

Note: The existing wifi related permissions in system_server is left
behind to allow the module to be loaded into system_server or
network_stack process depending on device configuration.

Bug: 113174748
Test: Device boots up and able to make wifi connection.
Test: Tested hotspot functionality.
Test: Ran WifiManagerTest & WifiSoftApTest ACTS tests locally.
Test: Will send for wifi regression tests.
Change-Id: Id19643a235bf0c28238f2729926b893ac2025b97
(cherry-picked from c7aa90091e6bec70a31a643cc4519a9a86fb0b38)
2019-07-16 13:30:15 -07:00
Pirama Arumuga Nainar
2d16fef4ce Merge "Revert "Track usbd SELinux denial."" 2019-07-16 01:17:10 +00:00
Kiyoung Kim
8231ac82e5 Merge "Add linker config generator and output file to sepolicy" 2019-07-16 00:32:13 +00:00
Tom Cherry
4c52cedf22 Merge "Allow dumpstate to read /data/misc/logd always" 2019-07-15 23:28:23 +00:00
Pirama Arumuga Nainar
98e320b6e0 Revert "Track usbd SELinux denial."
Bug: 72472544
This reverts commit 07efe37c5f.

Reason for revert: The selinux denial is no longer reproducible.

Test: Presubmit builds

Change-Id: I79d18743171315401401c1b06b3f97d837bf500f
2019-07-14 21:05:41 -07:00
Kiyoung Kim
affa6f323c Add linker config generator and output file to sepolicy
Sepolicy for linkerconfig generator and ld.config.txt file from
generator

Bug: 135004088
Test: m -j & tested from device
Change-Id: I2ea7653a33996dde67a84a2e7a0efa660886434a
2019-07-12 12:32:19 +09:00
Brad Ebinger
243ef72edb Rename service from ircs to ircsmessage
ircs is not specific enough. There will be multiple services in the
future with ircsmessage used specificially for  message store.

Test: compile, tests
Change-Id: Ia7d57e6900c733408be26d6520aa46c512229248
2019-07-11 14:09:51 -07:00
Mikael Pessa
25870c05c8 Merge "Give surfaceflinger permission to write perfetto traces" 2019-07-09 21:08:52 +00:00
Mikael Pessa
c97ea91e2f Give surfaceflinger permission to write perfetto traces
Test: Manual tests
Bug: 137050898
Change-Id: I00f67a666cbf265950aa9160d82e16bef2b2e423
2019-07-09 17:16:07 +00:00
Justin Yun
87b4b81190 Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I395324d369d9467895471f5b62d327fd9b3381dc
2019-07-09 08:57:35 +00:00
Tom Cherry
77f8d4f8ca Allow dumpstate to read /data/misc/logd always
There is no reason to deny dumpstate from reading /data/misc/logd on
user builds.  Logpersist is disallowed from running on those builds,
so there is no harm in copying this directory.

Bug: 136978224
Test: build
Change-Id: Ia58bde10e1f45978975597cd2ea1951a784d3b49
2019-07-08 13:20:10 -07:00
Treehugger Robot
18898abf3f Merge "Sepolicy for added SystemSuspend HAL to ANR list." 2019-07-01 21:43:45 +00:00
Sidath Senanayake
56d34f7838 Merge "Allow perfetto to access gpu_frequency tracepoint in user" 2019-06-28 18:46:02 +00:00
Kalesh Singh
113d10baaa Sepolicy for added SystemSuspend HAL to ANR list.
Change-Id: Ib7b647d07c5432ed4cdb674f3c9642cfcb5c9d79
Bug: 135458700
Fixes: 135458700
Test: Trigger ANR dump (adb shell am hang).
grep through logcat for sepolicy denials.
2019-06-28 10:08:22 -07:00
Andrew Sapperstein
6eaf8a2d62 Merge "Revert "Revert "Allow rule to let settings access apex files""" 2019-06-28 15:30:36 +00:00
Andrew Sapperstein
544a9b1c51 Revert "Revert "Allow rule to let settings access apex files""
This reverts commit e47d2365a8.

Reason for revert: Original CL was not the cause of the breakage. It went green before this revert landed. https://android-build.googleplex.com/builds/branches/aosp-master/grid?

Original CL went in 5695273.
Went green in 5695399.
Revert went in 5695588.

Change-Id: Ie4d7065fe7d3c58cdff99c2b7d76b50b941895bb
2019-06-28 15:28:28 +00:00
Cosmo Hsieh
71e1c36956 Merge "Revert "Allow rule to let settings access apex files"" 2019-06-28 09:59:04 +00:00
Cosmo Hsieh
e47d2365a8 Revert "Allow rule to let settings access apex files"
This reverts commit 0c0ba46192.

Reason for revert: <Broken build 5695273 on aosp-master on aosp_x86_64-eng>

Change-Id: I763f19aa5b72f2e1aaebbc78bb8ab3020c3d2a7b
2019-06-28 09:51:28 +00:00
Andrew Sapperstein
bfe6fdedba Merge "Allow rule to let settings access apex files" 2019-06-28 04:52:35 +00:00
Todd Kennedy
0c0ba46192 Allow rule to let settings access apex files
In order to show licensing information, we need to read it from
an asset stored in the .apex file.

Bug: 135183006
Test: Manual; settings can access apex files stored on /data
Change-Id: I71fbde6e295d9c890c9b9b0449e5150834a6680e
2019-06-27 18:34:25 +00:00
Sidath Senanayake
4b25c0a65a Allow perfetto to access gpu_frequency tracepoint in user
This will allow Perfetto to capture GPU frequency changes
on the target, which is useful to graphics developers
using Perfetto to profile graphics HW usage.

Bug: 136062452
Change-Id: Idb7870b2f674f1359ef3b4487dbeff190b394248
2019-06-26 18:06:48 +01:00
Treehugger Robot
9cc85328ea Merge "atrace: allow tracing of vibrator hal" 2019-06-25 02:23:25 +00:00
Tom Cherry
946dd43afb Merge "Use a property instead of file to communicate cold boot done" 2019-06-24 19:39:03 +00:00
Treehugger Robot
828722b4af Merge "Add power stats HAL to ANR list" 2019-06-20 17:26:04 +00:00
Tom Cherry
2a67e947c6 Use a property instead of file to communicate cold boot done
Ueventd can't set properties currently, but this is an artificial
limitation, since ueventd communicates to init that it has finished
cold boot via a file, and init polls this file instead of returning to
the epoll loop, where properties are handled.

A related change replaces that file with a property and thus frees
ueventd to be able to set properties.  This change creates the
cold_boot_done property type for this property and gives only ueventd
permissions to set it.

Bug: 62301678
Test: boot, check that properties are set
Change-Id: I40843b423b192ea841db6a82f648e5bab9738e0e
2019-06-20 08:37:46 -07:00
Kevin Chyn
0bdb4f269f Merge "Add rules to dump hal traces" 2019-06-20 07:14:51 +00:00
Kevin Chyn
a18c5bdd70 Add rules to dump hal traces
Test: manual
Bug: 126802513

Change-Id: If037483f305e161a158e30f6322d5e25b7770952
Merged-In: If037483f305e161a158e30f6322d5e25b7770952
2019-06-20 00:31:03 +00:00
Treehugger Robot
f4362c08c7 Merge "Revert "Allow hal_face to write to /data/vendor/camera_calibration/*."" 2019-06-19 23:44:27 +00:00
Benjamin Schwartz
405549afd6 Add power stats HAL to ANR list
Bug: 135111122
Test: Ran "adb shell am hang" and verified that power.stats HAL
information is in /data/anr/<anr_file>
Change-Id: I60a6191626a20c737124033e8ad453fa91425e39
(cherry picked from commit 8273f1915f)
2019-06-19 14:35:30 -07:00
Matthias Kramm
ebcc08249b Revert "Allow hal_face to write to /data/vendor/camera_calibration/*."
This reverts commit 3a44b17897.

Reason for revert: Moved to downstream repo.

Change-Id: I7d3ad43335f71ed03e7a93bc5c96a8933785afd8
2019-06-19 20:15:50 +00:00
Tao Bao
a999e39423 Add persist.sys.theme.
This property will be set by system_server (to indicate the currently
selected theme for device), and can be accessed by vendor init.rc.

avc:  denied  { read } for property=persist.sys.theme pid=0 uid=0 gid=0 scontext=u:r:vendor_init:s0 tcontext=u:object_r:theme_prop:s0 tclass=file

Bug: 113028175
Test: Set a vendor init trigger that waits on `persist.sys.theme`. Check
      that the trigger fires without denial.
Change-Id: Ia85b1a8dfc118efdbb9337ca017c8fb7958dc386
Merged-In: Ibb4e392d5059b76059f36f7d11ba82cd65cbe970
(cherry picked from commit 75182a1ea6)
2019-06-18 17:36:21 -07:00
Nicolas Geoffray
3a9a6f51c1 Merge "Allow zygote to create fds and map executable." 2019-06-18 06:51:39 +00:00
Matthias Kramm
9faeec71f2 Merge "Allow hal_face to write to /data/vendor/camera_calibration/*." 2019-06-17 19:31:50 +00:00
Nicolas Geoffray
f77e8c1b0c Allow zygote to create fds and map executable.
This is so that zygote can create the JIT cache with memfd_create
(or ashmem when memfd is not available).

Test: boot
Bug: 119800099
Change-Id: I88f1f6b1c930a8d22985b306a238f60b4af59f9c
2019-06-17 20:18:23 +01:00
Harpreet "Eli" Sangha
1b62e7fd9d atrace: allow tracing of vibrator hal
Test: On-Device Systrace
Change-Id: I4172c83cf50106d28eb7b9330c5bb559fabc504b
Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
2019-06-17 12:25:05 +09:00
Treehugger Robot
1eb45b5606 Merge "In native coverage builds, allow all domains to access /data/misc/trace" 2019-06-14 18:35:25 +00:00
Pirama Arumuga Nainar
ce9c0c5a5f In native coverage builds, allow all domains to access /data/misc/trace
Bug: http://b/135139675

Coverage files are written to /data/misc/trace (governed by the
method_trace_data_file selinux type).  Allow all domains to access
(create directories, access files) this directory when native coverage
is enabled (by setting NATIVE_COVERAGE to true) in an userdebug or eng
build.

Also relax neverallow constraints to allow access to
method_trace_data_file for native coverage builds.

Test: Build 32-bit cuttlefish with coverage:
          m NATIVE_COVERAGE=true COVERAGE_PATHS="*"
      and verify that there are no selinux denials in kernel log and
      logcat.

Change-Id: I3fe7c77612854b9de7de7a0ddd5cbf44a2f5c21e
2019-06-14 08:31:51 -07:00
Matthias Kramm
3a44b17897 Allow hal_face to write to /data/vendor/camera_calibration/*.
Also, allow hal_camera to read from there.

Bug: 133792720
Change-Id: Iedec8d7325b4424d166f8e4d09182e1f29808ef2
Test: Running presubmit.
2019-06-14 05:53:59 -07:00
Jiyong Park
6e823dd597 Allow apexd to stop itself
apexd stops itself when it finds that it is running on a device with
flattened APEXes (i.e. ro.apex.updatable = false).

Bug: 133907211
Test: launch sdk_phone_x86_64
adb logcat -d | grep apexd | wc -l
returns 3

Change-Id: I7fa161b069aa34adb028194b55f367fe740a0cfc
2019-06-13 09:45:05 +09:00
David Anderson
4afae94836 Merge "Allow gsid to read dm nodes from sysfs." 2019-06-12 21:09:59 +00:00
Treehugger Robot
ab1e359761 Merge "Add core domain attribute to perfprofd for all targets" 2019-06-08 06:06:17 +00:00
David Anderson
95fbedd1b0 Allow gsid to read dm nodes from sysfs.
This is needed now that libfiemap_writer reads from dm/name to find
device-mapper names.

Bug: 134536978
Test: gsi_tool install
Change-Id: I10e1234f2ea39c92b43ace97fa76878358dfc476
2019-06-07 14:59:00 -07:00
Ryan Savitski
ce3a33ff18 userdebug: support perfetto traces as a section in incident reports
This set of patches adds a way for the perfetto command line client to
save a trace to a hardcoded location,
/data/misc/perfetto-traces/incident-trace, and call into incidentd to
start a report, which will include said trace in a new section.

This is not a long-term solution, and is structured to minimize changes
to perfetto and incidentd. The latter is currently architected in a way
where it can only pull pre-defined information out of the system, so
we're resorting to persisting the intermediate results in a hardcoded
location.

This will introduce at most two more linked files at the same time.

Bug: 130543265
Bug: 134706389
Tested: manually on blueline-userdebug
Change-Id: I2aa27e25f0209b3a5cdf5d550d0312693932b808
2019-06-07 01:00:53 +01:00
Kalesh Singh
1fc57087b4 Add core domain attribute to perfprofd for all targets
We want "vendor domain" which is referred to as { domain -coredomain
-appdomain }, to behave the same on user vs userdebug builds.

Bug: 134161662
Test: m selinux_policy / Check logcat for denials
Change-Id: If6757c820ed657ba2b70263bb546a456adcc7cff
2019-06-06 20:57:28 +00:00
Luke Huang
848075e330 Merge "Clean sepolicy of unused netd_socket" 2019-06-03 06:39:15 +00:00
Tri Vo
50aa029f4b Reland "Add 29.0 mapping files"
Steps taken to produce the mapping files:

1. Add prebuilts/api/29.0/[plat_pub_versioned.cil|vendor_sepolicy.cil]
plat_pub_versioned.cil contains all public attributes and types from Q
Leave vendor_sepolicy.cil is empty.

2. Add new file private/compat/29.0/29.0.cil by doing the following:
- copy /system/etc/selinux/mapping/29.0.cil from pi-dev aosp_arm64-eng
device to private/compat/29.0/29.0.cil
- remove all attribute declaration statement (typeattribute ...) and
sort lines alphabetically
- some selinux types were added/renamed/deleted w.r.t 29 sepolicy.
Find all such types using treble_sepolicy_tests_29.0 test.
- for all these types figure out where to map them by looking at
28.0.[ignore.]cil files and add approprite entries to 29.0.[ignore.]cil.

This change also enables treble_sepolicy_tests_29.0 and installs
29.0.cil mapping file onto the device.

Bug: 133155528
Bug: 133196056
Test: m treble_sepolicy_tests_29.0
Test: m 29.0_compat_test
Test: m selinux_policy
Change-Id: I9e83e9bf118c8b8f8fcf84d5c0dcb6eb588e0d55
2019-06-01 17:20:34 -07:00
Luke Huang
3a97f5ae8c Clean sepolicy of unused netd_socket
Bug: 65862741
Test: built, flashed, booted
Change-Id: I25578e54f8c222d381c8f8ea0ec143b5b503b6a6
Merged-In: I726aadd54b04df68cff992b70443c0335ca50972
2019-05-30 17:41:16 +08:00
Treehugger Robot
b374835ffb Merge "Sepolicy for IAshmem HIDL interface" 2019-05-30 07:36:41 +00:00
Kalesh Singh
46303aa1f7 Sepolicy for IAshmem HIDL interface
Change-Id: Id78f995661120f136d671ea0084db358e7662122
Bug: 133443879
Test: Manually check logcat for sepolicy denials (logcat | grep IAshmem)
2019-05-29 14:44:47 -07:00
Jiyong Park
04d2392c35 Don't use apexd when TARGET_FLATTEN_APEX == true
/system/apex/com.android.runtime is labeled as runtime_apex_dir
and init is allowed to mount on it.

When TARGET_FLATTEN_APEX is true (= ro.apex.updatable is unset or set to
false), apexd is not used to activate the built-in flattened APEXes.
Init simply bind-mounts /system/apex to /apex.

However, there is a special case here. The runtime APEX is installed as
either /system/apex/com.android.runtime.debug or
/system/apex/com.android.runtime.release, whereas it should be activated
on /apex/com.android.runtime - without the .debug or .release suffix.
To handle that case, the build system creates an empty directory
/system/apex/com.android.runtime and the .debug or .release directory
is bind-mounted to the empty directory by init at runtime.

Bug: 132413565
Test: marlin is bootable
Merged-In: I3fde5ff831429723fecd1fa5c10e44f636a63f09
Change-Id: I3fde5ff831429723fecd1fa5c10e44f636a63f09
(cherry picked from commit 99902a175b)
2019-05-29 07:06:28 +09:00