Commit graph

1269 commits

Author SHA1 Message Date
Akos Denke
bb61a6e79d Add correct permissions to benchmarktest directories
Change-Id: I487d59317635b54f623002baf3c00aa47910a33a
2020-02-10 12:11:54 -05:00
Hridya Valsaraju
5cdb5d4619 trace-container: Check /sys/kernel/tracing for tracefs
tracefs will be mounted at /sys/kernel/tracing when debugfs
is not mounted.

Bug: 134669095
Test: atest AtraceHostTest
Change-Id: I8178babaa6928ac3796622bdb08f123428ccd191
2020-02-07 11:08:21 -08:00
Treehugger Robot
e6acbfe556 Merge "Add AID_EXT_DATA_RW / AID_EXT_OBB_RW GIDs." 2020-02-03 10:14:33 +00:00
Martijn Coenen
4501ed5c2e Add AID_EXT_DATA_RW / AID_EXT_OBB_RW GIDs.
These will be used as a GID for the Android/data and Android/obb
directories respectively, on devices that don't have sdcardfs.

Bug: 146419093
Test: builds
Change-Id: I52a3235e872eb4b0402f918d5c47661f16626ba6
2020-01-31 15:12:31 +01:00
Hridya Valsaraju
6a879b25d9 Check /sys/kernel/tracing for tracefs
When debugfs is not mounted, atrace should look for
tracefs in /sys/kernel/tracing.

Test: CtsAtraceHostTestCases
Bug: 148436518
Change-Id: I45c0e664892bcda277fd9612106ad5216aea0a1b
2020-01-30 17:38:51 -08:00
Zimuzo Ezeozue
8e4cf5b436 Merge "Add external_storage gid" 2020-01-27 12:22:16 +00:00
Zim
bdeaf57da3 Add external_storage gid
This gid allows processes full access to public areas of external
storage. This includes the following:
1. EmulatedVolumes: All files and directories excluding the app
specific directories under Android/
2. PublicVolumes: Including 'unreliable' volumes (USB OTG) that are
not typically accesible to ordinary apps

Apps with the MANAGE_EXTERNAL_STORAGE permission will automatically
have this gid

Test: m
Bug: 144914977
Change-Id: I17da0b2367e356edc031d063e214574463afc985
2020-01-24 16:54:03 +00:00
Yifan Hong
04b932b8fd Add e2fsck to fs_config
Test: boot and look at serial console
Bug: 147347110
Change-Id: Ife664c02fa4cf86d9385caff734d2bb3e56d988f
2020-01-22 16:47:14 -08:00
Treehugger Robot
0852b10b37 Merge "[vts-core] Make VtsKernelLibcutilsTest runnable by base TradeFed" 2020-01-20 02:32:56 +00:00
nelsonli
d83f390896 [vts-core] Make VtsKernelLibcutilsTest runnable by base TradeFed
Create KernelLibcutilsTest and add it to vts-core.
VtsKernelLibcutilsTest just run the test of libcutils_test_static
and filter-out all of the test except AshmemTest#. We can just use the
include-filter to do the same thing.

Bug: 147789274
Test: atest KernelLibcutilsTest
Change-Id: Idb5cee3596bf063c2419f1a11055a17ad3075e26
2020-01-17 09:48:58 +08:00
David Zeuthen
e83f386653 Add user for credstore.
The credstore system daemon is running as an unprivileged user. This
CL adds this user and also creates a directory (/data/misc/credstore/)
where this daemon can store its data.

Bug: 111446262
Test: N/A
Change-Id: I8da2c32dd04fef797870b8a7bbc5e499bed71f9e
2020-01-16 07:32:04 -05:00
Treehugger Robot
6e016ef80e Merge "libcutils: fallback to /dev/ashmem" 2020-01-15 19:48:26 +00:00
Steven Moreland
4f99dd3af1 libcutils: fallback to /dev/ashmem
For a Q APEX built with use_vendor, rather than using AIDL to talk to
ashmemd, it would directly open /dev/ashmem. R libcutils does ashmem
differently, but in order to allow R-built APEXes to replace this
category of APEXes, falling back to /dev/ashmem.

Fixes: 147363115
Test: tested on Q in swcodec APEX
Change-Id: I625e46b15fee6649251ab9be7a1bbe11c5427525
2020-01-14 18:19:10 +00:00
Florian Mayer
445234c76c Merge "Use sequence number to check if to reload atrace tags." 2020-01-14 09:37:04 +00:00
Florian Mayer
b06766cbbf Use sequence number to check if to reload atrace tags.
This is to deprecate the sysprop change notification in atrace.
After this change, processes will only update their enabled tags
at the first atrace event. Previously we reloaded the tags as a
result of the sysprop changed Binder notification, which woke up
every process in the system.

Test: adb shell su root atrace -t 10 ss
Test: #define ATRACE_SHMEM 0; adb shell su root atrace -t 10 ss

Bug: 137366208

Change-Id: Idffba5fd4ba23fba2f6b9f594365df68ac0c1626
2020-01-13 17:02:58 +00:00
Ady Abraham
21844fa771 SurfaceFlinger: migrate capabilities to surfaceflinger.rc
SurfaceFlinger requires CAP_SYS_NICE which is set in
libcutils/fs_config.cpp. This is the old way of setting capabilities
and new the way is to set it directly on surfaceflnger.rc

Test: adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test
Test: adb shell stop surfaceflinger && adb shell start surfaceflinger
Bug: 147271477
Change-Id: I680509a385928a9c929d4fe4857118af219e2b13
2020-01-08 19:35:57 +00:00
Jooyung Han
08792eb5de Add system_ext/apex/*/bin to fs_config
Flattened APEXes can be installed in /system_ext.
Especially, GSI have both flattened/unflattened apexes so that it can
run with updatable devices and non-updatable devices as well.

Bug: 145963716
Test: flash GSI on P device and boot
Change-Id: I3a941672446a5353517243a851739a66f4252617
2019-12-20 03:54:57 +09:00
Tom Cherry
2d5cfa9fa6 Remove warning from VNDK's <cutils/log.h>
We're never going to fix this warning and it's not causing any active
issues that vendors are using this header.  It is however causing
active issues that we have extraneous warning messages in the log.

Bug: 123758136
Test: no build warnings from <cutils/log.h>
Change-Id: Iccf702bf2536ba106a00ac04467d54401cbe2a50
2019-12-04 08:33:49 -08:00
Treehugger Robot
02359c6d96 Merge "Use PLOG and TEMP_FAILURE_RETRY for uevent socket errors" 2019-11-13 16:50:46 +00:00
Elliott Hughes
2ba8c4b0af Merge "Ignore nullptr in native_handle_close()." 2019-11-13 16:04:22 +00:00
Tom Cherry
edad2bf9b6 Use PLOG and TEMP_FAILURE_RETRY for uevent socket errors
Use TEMP_FAILURE_RETRY() for recvmsg() to prevent failing
unnecessarily from EINTR.  Use PLOG(ERROR) in ueventd to display the
actual error if reading from the uevent socket does fail.

Test: build
Change-Id: I64a22698ce6ffc7573f75b57803551c7b6940e30
2019-11-13 07:21:42 -08:00
Elliott Hughes
7e42484610 Ignore nullptr in native_handle_close().
Just like native_handle_delete().

Bug: http://b/143898343
Test: new test
Change-Id: I373067aa6c2b03548b218c7011bdbf23bd71f260
2019-11-12 20:23:55 -08:00
Elliott Hughes
d91984a890 libcutils: remove unused socket_set_receive_timeout().
Test: treehugger
Change-Id: I834762fd83bdaa3b714c7531439bf9115a82e342
2019-11-08 15:21:39 -08:00
Tom Cherry
e41aded12d Add require_root for libcutils tests
7 of these tests require root

Test: these tests pass as root
Change-Id: Ife4d1ae0c8fe8a2ace288c584ac044a37bae0b3e
2019-11-07 14:06:21 -08:00
Treehugger Robot
ad3069eb72 Merge "Turn on executable bit on system_ext/bin" 2019-11-07 15:13:56 +00:00
Jeongik Cha
4e467e71e9 Turn on executable bit on system_ext/bin
Setting executable bit on system_ext/bin is missing, so add them into
list.

Bug: 144066307
Test: m && check if system_ext/bin/* have execute permission.
Change-Id: I89c9e0d2d54f965ecd058bb9e77ba77b7ed164c1
2019-11-07 16:51:49 +09:00
Tom Cherry
f8baa897ec libcutils: update fs_config tests for current behavior
Update fs_config tests for the new behavior in
a8eb00720c.

Before the above CL, fs_config_cmp() would match any partition prefix
to any path, even if there is not a logical relationship between them.
For example, these two lines in the test the demonstrate the changed
behavior:

{ true,  "vendor/lib",             "system/vendor/lib/hw",    true },
{ true,  "system/vendor/lib",      "vendor/lib/hw",           true },

The first line should match and does; it is testing that files located
at system/vendor/lib/hw are matched by an fs_path_config entry
specified as vendor/lib.  This is to allow for applying the policy we
have for the vendor partition to files in /system/vendor in the case
that there is no vendor partition.

The second line should not match.  This is testing that a file
that's located at vendor/lib/hw is matched by an fs_path_config entry
specified as system/vendor/lib.  This is backwards; we do not want to
have policy specified for system/vendor to impact policy for the
vendor partition.

Also, we never have any relationships from /system/oem to /oem or
/system/odm to /odm, so these are logically unrelated and should fail
to match.  We do however have a relationship from /vendor/odm to /odm,
so this test is added.

Test: libcutils unit tests pass on CF
Change-Id: I026f0233e00bbd0aad9bc0fb701aef000d2a037c
2019-11-06 09:40:33 -08:00
Tom Cherry
350164cc7c Revert "liblog: remove mistakenly added symbols from vndk"
This reverts commit 5f8162b086.

Reason for revert: Turns out they're being used.

Merged-In: Iad9010190c7a4140b69dc553df5debdd88dcf81a
Change-Id: Iad9010190c7a4140b69dc553df5debdd88dcf81a
2019-10-23 11:39:13 -07:00
Tom Cherry
7867721e51 liblog: remove mistakenly added symbols from vndk
These functions and headers were all mistakenly added to the vndk.
They should not be used by vendors.

Test: these symbols do not appear in vendor libraries
Merged-In: I03919b437c2d9f0e573b7a6b40249ed12fe874b9
Change-Id: I03919b437c2d9f0e573b7a6b40249ed12fe874b9
2019-10-22 09:47:45 -07:00
Treehugger Robot
ed2d29ea13 Merge "sched_policy: add get_cpuset/sched_policy_profile_name" 2019-10-16 02:44:22 +00:00
Wei Wang
ee2f260223 sched_policy: add get_cpuset/sched_policy_profile_name
Expose API to return name of task profile for cpuset/sched policy so
that libprocessgroup clients using SetTaskProfiles directly don't have
to maintain the mapping. This reduces the risk of inconsistency and saves
memory.

Bug: 139521784
Test: atest libcutils_test:SchedPolicy
Change-Id: I414312a038613913fb6a827bdcefceb3dec21264
2019-10-14 20:03:06 -07:00
Florian Mayer
ad427b74c4 Remove useless goto.
Test: build

Change-Id: Ifb8d832de1115eefbf2e09c6d5c8f03244566933
2019-10-10 18:15:24 +01:00
Bill Peckham
dea8c9c1ac Moving recovery resources from /system to /vendor
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.

The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.

* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)

This change moves the recovery resources to vendor in libcutils/fs_config.cpp
and removes the flash_recovery service from rootdir/init.rc. This service moved
to a vendor init.rc file in bootable/recovery/applypatch.

Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: I492f7989ea8042912e9d0e0eadeaa351affbee13
2019-10-04 00:04:08 +00:00
Tri Vo
92fd3caff7 libcutils: route to /dev/ashmem<boot_id> instead of ashmemd
Having libcutils ask ashmemd for ashmem fds results in unsatisfactory
performance/memory overhead. Introduce a duplicate of /dev/ashmem and
route to it instead.

Our goal remains as before, namely, use SELinux to phase out usage of
ashmem that doesn't go through libcutils.

Bug: 139855428
Test: boot aosp_crosshatch, browse internet, use camera
Change-Id: I02260a9042acb412571b11f1f4c1d8608483064a
2019-09-25 12:50:16 -07:00
Treehugger Robot
cda0a308eb Merge "Allocate UID for fs-verity ownership in keystore" 2019-09-17 16:08:48 +00:00
Nick Kralevich
6bcd50ed6d system/apex/*/bin should be 0751
Consistent with other bin directories, system/apex/*/bin should
be 0751.

Test: compiles and boots
Change-Id: Ie32e7623d2b2eb923417d0c2ba3ee6899a9bfc7b
2019-09-10 18:54:28 -07:00
Victor Hsieh
5f327d24c3 Allocate UID for fs-verity ownership in keystore
Test: compile and use
Bug: 112038744
Change-Id: Ic129484a0f6f266bb58f8afd722d5d8f7565b922
2019-09-05 16:18:13 -07:00
Xin Li
d0a45dbc9a Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:23 +00:00
Steven Moreland
c0660668e7 libcutils: Implement ashmem_valid on host.
Was missing.

Bug: 124524556
Test: build host code with dependency on this
Change-Id: I0074923e9ec53e42f9479fff47df0a24c8750164
2019-09-05 01:26:19 +00:00
Elliott Hughes
13e64377b3 Merge "Reland "libcutils: remove unused "jstring.h"."
am: a22599df58

Change-Id: I7ea8fa894ed60fc64534a6de312258b75b3bff8e
2019-08-12 11:40:28 -07:00
Elliott Hughes
79198d9ade Reland "libcutils: remove unused "jstring.h".
This reverts commit 09ba34925f.

Bug: http://b/139257138
Test: treehugger
Change-Id: Id9b612c5a79b89ed17d2205219af19788ae96c9e
2019-08-12 15:09:20 +00:00
Mason Wang
1967bf3f07 Merge "Revert "libcutils: remove unused "jstring.h".""
am: 4b8e6b673f

Change-Id: I2ec20c825970beefae2c9b2693506c2d7d3165d5
2019-08-11 22:40:42 -07:00
Mason Wang
09ba34925f Revert "libcutils: remove unused "jstring.h"."
This reverts commit aa96e8898c.

Reason for revert: It caused BB, and b/139257138 is for your reference

Change-Id: I93f1d0ba0fa43325e2815e9b2de84bb7cb41c457
2019-08-12 02:16:58 +00:00
Elliott Hughes
94879d3b9f Merge "libcutils: remove unused "jstring.h"."
am: e2adc14803

Change-Id: I2d779ea267d1177ace3d18290f61b9006d86ce25
2019-08-11 08:51:52 -07:00
Elliott Hughes
aa96e8898c libcutils: remove unused "jstring.h".
Test: treehugger
Change-Id: I56989862a51a6c8785f22f783027d50c42be650c
2019-08-08 17:45:48 -07:00
Elliott Hughes
498163c28a Merge "Remove more dead code."
am: 0c2dab9adf

Change-Id: I52dbcba34d893573b3452c7b084af8840e5c1ec1
2019-08-08 12:40:55 -07:00
Elliott Hughes
1547e4a316 Remove more dead code.
Test: treehugger
Change-Id: I2b7f606241cde2c2743d8021fad00d30f7e0b0de
2019-08-07 14:52:16 -07:00
Tom Cherry
306ca15d79 Merge "Add reserved AID ranges for all partitions"
am: 2a0a0810a1

Change-Id: I639c3ed66293da360318b5979480c1def45f1955
2019-07-15 16:32:41 -07:00
Tom Cherry
2a0a0810a1 Merge "Add reserved AID ranges for all partitions" 2019-07-15 23:19:41 +00:00
Justin Yun
e0b1eb8d65 Merge "Rename product_services to system_ext"
am: 6da50e319c

Change-Id: If9eaecca2382b3ace74ae721e80d51c79bb9b0fb
2019-07-11 00:15:28 -07:00