summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-26Merge cherrypicks of [16718400] into sc-d2-release.android-12.1.0_r26android-12.1.0_r25android-12.1.0_r24android-12.1.0_r23android-12.1.0_r18android-12.1.0_r17android-12.1.0_r16android-12.1.0_r15android-12.1.0_r14android-12.1.0_r13android-12.1.0_r12android12L-d2-s8-releaseandroid12L-d2-s7-releaseandroid12L-d2-s6-releaseandroid12L-d2-s5-releaseandroid12L-d2-s4-releaseandroid12L-d2-s3-releaseandroid12L-d2-s2-releaseandroid12L-d2-s1-releaseandroid12L-d2-releaseAndroid Build Coastguard Worker
Change-Id: I199c886a26c85b51d769f9f3006bd60054df2e3b
2022-01-26init: Wait for snapuserd before starting second stageAkilesh Kailash
This is a race between init process and bionic libc initialization of snapuserd. init->fork() ----------------> SecondStageMain() -> PropertyInit() | | v execveat ---> __libc_init_common() -> __system_properties_init() (snapuserd) When init process calls PropertyInit(), /dev/__properties__ directory is created. When bionic libc of snapuserd daemon invokes __system_properties_init _after_ init process PropertyInit() function is invoked, libc will try to initialize the property by reading /system/etc/selinux/plat_property_contexts. Since any reads on /system has to be served by snapuserd, this specific read from libc cannot be serviced leading to deadlock. Reproduce the race by inducing a sleep of 1500ms just before execveat() so that init process calls PropertyInit() before bionic libc initialization. This leads to deadlock immediately and with additional kernel instrumentation with debug logs confirms the failure: ====================================================== init: Relaunched snapuserd with pid: 428 ext4_file_open: SNAPUSERD: path /system/etc/selinux/plat_property_contexts - Pid: 428 comm 8 ext4_file_read_iter: SNAPUSERD for path: /system/etc/selinux/plat_property_contexts pid: 428 comm 8 [ 25.418043][ T428] ext4_file_read_iter+0x3dc/0x3e0 [ 25.423000][ T428] vfs_read+0x2e0/0x354 [ 25.426986][ T428] ksys_read+0x7c/0xec [ 25.430894][ T428] __arm64_sys_read+0x20/0x30 [ 25.435419][ T428] el0_svc_common.llvm.17612735770287389485+0xd0/0x1e0 [ 25.442095][ T428] do_el0_svc+0x28/0xa0 [ 25.446100][ T428] el0_svc+0x14/0x24 [ 25.449825][ T428] el0_sync_handler+0x88/0xec [ 25.454343][ T428] el0_sync+0x1c0/0x200 ===================================================== Fix: Before starting init second stage, we will wait for snapuserd daemon to be up and running. We do a simple probe by reading system partition. This read will eventually be serviced by daemon confirming that daemon is up and running. Furthermore, we are still in the kernel domain and sepolicy has not been enforced yet. Thus, access to these device mapper block devices are ok even though we may see audit logs. Note that daemon will re-initialize the __system_property_init() as part of WaitForSocket() call. This is subtle but important; since bionic libc initialized had failed silently, it is important that this re-initialization is done. Bug: 207298357 Test: Induce the failure by explicitly delaying the call of execveat(). With fix, no issues observed. Tested incremental OTA on pixel ~15 times. Ignore-AOSP-First: cherry-pick from AOSP Signed-off-by: Akilesh Kailash <akailash@google.com> Change-Id: I86c2de977de052bfe9dcdc002dcbd9026601d0f3 (cherry picked from commit 65f3d09445699910947fd73b35979121b2bf07fb) Merged-In:I86c2de977de052bfe9dcdc002dcbd9026601d0f3
2022-01-21Snap for 8099527 from ae5fe46ece70b797206cef277c6f19dcf7ec5539 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: Ia9e50c1c4db7dc8065607105143a451ec741b327
2022-01-20Merge changes Id79f9e10,Ia91d8839 into sc-v2-devWei Wang
* changes: libprocessgroup: Use WriteStringToFd for WriteFileAction libprocessgroup: Prevent error spam when tests disable all cpus in a cpuset
2022-01-15Snap for 8084085 from 71429a9738471920772df0d5d50a820aa0d50fbe to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I81ebaf462d235ba97290760b1e72e007bb581b4a
2022-01-14Add group ID for reading tracefsKalesh Singh
Add AID_READTRACEFS and mount tracefs with gid=AID_READTRACEFS Bug: 209513178 Bug: 214061655 Test: adb shell ls -l /sys/kernel/tracing/events Change-Id: Ibbfdf8a4b771bd7520ecbaaf15a1153d6bf0e599 Merged-In: Ibbfdf8a4b771bd7520ecbaaf15a1153d6bf0e599
2022-01-11Snap for 8060779 from 739f4f5f609846f11072ec5e0a45fdd8c4225e29 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I91799dceabd0976d8ec80632af6e84be2fa0ec7b
2022-01-07libsnapshot: Fix CHECK failure during second phase mergeDavid Anderson
This CHECK prevents a release build from resuming a two-phase merge if the merge initially failed in the first pass. Bug: 213031779 Bug: 213253413 Bug: 193549218 Ignore-AOSP-First: cherry-pick from AOSP Test: vts_libsnapshot_test Test: update_engine_unittests Change-Id: I8bf00e3016546ef7039bb0b18eb977cc3dc1066a Merged-In: I8bf00e3016546ef7039bb0b18eb977cc3dc1066a
2022-01-07Snap for 8050481 from 654bb5225bcaedb388839b60675c3751573bb174 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I12339c67ba35bca911326f5677bc16fca950d792
2022-01-05libsnapshot: Propagate merge phase across merge failures.David Anderson
If a merge fails we write a new snapshot status indicating that the merge failed. If this happens to occur during the second merge phase, we fail to propagate the phase counter to the new status. This means the merge is unlikely to make progress and succeed later. Bug: 213031779 Bug: 213253413 Bug: 193549218 Ignore-AOSP-First: cherry-pick from AOSP Test: inject transient failure into CheckMergeConsistency, apply OTA, reboot and complete merge. Change-Id: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f Merged-In: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f
2022-01-04Deflake libdm#CreateEmptyDevice testNikita Ioffe
Judging from local experiments, it looks like device-mapper doesn't always generate a uevent after DM_DEV_CREATE ioctl. Test: presubmit Bug: 193462349 Change-Id: I8a74375631b20c14a32a41dbaf38380ebc0078e6 Merged-In: I8a74375631b20c14a32a41dbaf38380ebc0078e6
2021-12-24Snap for 8026873 from ea376a5c0f7a48944083f5f2d40fba5a7f98f8c4 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I055a55bf363d566663b1ade1e0d9b0273d0bce3b
2021-12-23init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 ↵Alexander Potapenko
and <= 5.4 am: 17b1c428d4 am: 9c75c6983a Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15981481 Change-Id: I07e546548847d5741000cf1fc58bd22a01c9774d
2021-12-23[automerger skipped] Restrict creation of bootreceiver tracing instance to ↵Alexander Potapenko
64-bit systems. am: c81fec7d8e -s ours am: 4edf845185 -s ours am skip reason: skipped by user glider Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15981480 Change-Id: I27cc0ad3f6074fd2376bceafa002dcdb1147e588
2021-12-23init: introduce ro.kernel.version property am: 1c496e94e0 am: 2d64b0cafcAlexander Potapenko
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15981479 Change-Id: I4a9c0c38b7015a770fea5a9ad518e2e17a799042
2021-12-23init.rc: disable creation of bootreceiver tracing instance for kernels >=4.9 ↵Alexander Potapenko
and <= 5.4 am: 17b1c428d4 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15981481 Change-Id: Ied7cd88b05e75b7aa5e3333a55cd5524c78ec427
2021-12-23[automerger skipped] Restrict creation of bootreceiver tracing instance to ↵Alexander Potapenko
64-bit systems. am: c81fec7d8e -s ours am skip reason: skipped by user glider Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15981480 Change-Id: I090ea8262ddfc1da119b3dbf2e61c32bf67a6c9b
2021-12-23init: introduce ro.kernel.version property am: 1c496e94e0Alexander Potapenko
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15981479 Change-Id: I5f18d4e1e19d01c865ae40ae8e3368d67a3627e0
2021-12-17Snap for 8010657 from cf4b15e61fc7ac1202c645f2daea520048629a82 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I41469556840e108112bf7cd7e1ca9ecb47b0aaaa
2021-12-14libprocessgroup: fall back to cpuset in get_sched_policyWei Wang
Since vendor has a way to override the group cpu/schedtune setup, we cannot assume the group will always return valid data. This CL let get_sched_policy to fallback to cpuset if no valid data found in cpu/schedtune cgroup. In longer term, we should find a way to cache the group or app's process state in framework other than relying on reading cgroup back. Test: /data/nativetest64/libcutils_test/libcutils_test Bug: 210066228 Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I8b4396365a7fc2d93e3a22746195585c140eef3c
2021-12-14Snap for 7995257 from a2c0b86ad006876199a9b97c23958e54de7e869e to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: Id7613acc197a4c4ecb63dde40018e90311c81fa2
2021-12-13Merge "libutils: do not follow process's group" into sc-v2-devWei Wang
2021-12-12libprocessgroup: Use WriteStringToFd for WriteFileActionRick Yiu
Using WriteStringToFile will hold kernfs_mutex which is a big lock, so use WriteStringToFd instead. Besides, also support fd cache for it. Bug: 206970384 Test: build pass Change-Id: Id79f9e1095f52079393c58edb9a4d526f4cc6b5e Merged-In: Id79f9e1095f52079393c58edb9a4d526f4cc6b5e
2021-12-12libprocessgroup: Prevent error spam when tests disable all cpus in a cpusetSuren Baghdasaryan
UserLifecycleTests test disables all Little cores in the course of the test, which causes attempts to add a process into /dev/cpuset/restricted cpuset cgroup to fail with ENOSPC error code, indicating that a process is joining a cpuset cgroup with no online cpus. Current libprocessgroup implementation will log an error on each such occurrence, which spams the logs and makes it hard to analyze test results. Because this situation does not happen in production environment (we do not offline cpus), we can prevent flooding the logs by identifying this case, logging an appropriate error one time and ignore all later similar errors. Bug: 158766131 Test: adb shell "echo 0 > /sys/devices/system/cpu/cpu[0-3]/online" Test: start some apps, observe libprocessgroup errors in the logcat Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: Ia91d8839d86787569c255481bde077be51c43d93 Merged-In: Ia91d8839d86787569c255481bde077be51c43d93
2021-12-11Snap for 7989966 from d1dbabbd4e33a80c65d34ea85ca50e636388d444 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: Iea24c40c7c87ef2bd7a3c8a7a7bfc9fac8740eb7
2021-12-10Merge "Add /system_ext/etc/selinux/ to the debug policy search path for GSI" ↵Yi-yo Chiang
into sc-v2-dev
2021-12-10libutils: do not follow process's groupWei Wang
1) App doesn't have cgroup access and there is no purpose of reading cgroup for app. For system_server it should be known in foreground group. So there is no benefit of reading group. 2) Reading cgroup in apps can also cause contention for other cgroup operations. 3) vendor can change cgroup setting and get_sched_policy may return incorrect information for get_sched_policy_profile_name. Test: Boot Bug: 210011562 Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I8e8c8b346984781c56ec93c0616121f7d5c99fe5
2021-12-03Snap for 7963886 from 437522958814ef523d62d7fa988fef495cf7f6f4 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: Ia556bf64147d7ec8dff4c8daed025392e9cc06ca
2021-12-01snapuserd: Address alignment fault on 32-bit systemsAkilesh Kailash
When the scratch space is mmap'ed, the metadata buffer will be un-aligned. This may lead to alignment fault on 32-bit systems. Address this by temporarily copying it to buffer. No perf impact as this code path is not in I/O path and the copy is a for the size of metadata buffer which is 8k. Bug: 206426215 Test: Full and Incremental OTA on pixel 1: Compile snapuserd as 32 bit and reproduced the bug on pixel. 2: With fix - OTA applied successfully. 3: Reboot the device when merge was in-flight as the fix is primarily in that path. 4: Verify merge completion and data integrity post merge. Signed-off-by: Akilesh Kailash <akailash@google.com> Change-Id: Icd4a21d6a61f1ab36e65994c06a4d049a2ee741c Merged-In: I63c0d862057ebf138c9d1696a942030e30598739
2021-11-24Add /system_ext/etc/selinux/ to the debug policy search path for GSIYi-Yo Chiang
This change only *adds* /system_ext/etc/selinux to the debug policy search path, and does not change any preconditions to load the debug policy. The device still needs to be bootloader-unlocked and has the debug ramdisk flashed to be able to use the debug policy. The only thing changed is that now the debug policy can be loaded from /system_ext or /debug_ramdisk when system partition is compliance testing GSI. The debug policy in the boot ramdisk may be outdated if the system partition is flashed with a image built from a different revision. This happens frequently when running the compliance testing VTS, where the device is flashed with (A) GSI and (B) device vendor image & debug boot image, and (A) and (B) are built from different git revisions. To address this, we install a copy of the debug policy under /system_ext, so that the version desync between (A) & (B) wouldn't be a problem anymore because (A) no longer relies on the debug policy file from (B). Bug: 188067818 Test: Flash RQ2A.201207.001 bramble-user with debug ramdisk & flash gsi_arm64-user from master, device can boot and `adb root` works Change-Id: I4d6235c73472e4d97619b2230292e6a0bc4b3e05 Merged-In: I4d6235c73472e4d97619b2230292e6a0bc4b3e05 (cherry picked from commit 650b29d2349253a0dd6000564ccb2c19b51352db)
2021-11-12Snap for 7906314 from 4f95599b96bb6431e56cfb93ff4f7e31c4322edf to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: Iaa99f216a409e8ece99e19935000e730c47b1fde
2021-11-11llkd: Disable in userdebug builds by defaultSuren Baghdasaryan
While llkd helps in discovering issues in apps which leave zombies, it creates issues for dogfooders when apps are killed. Disable it by default. Bug: 202411543 Test: boot and check llkd not running Test: `setprop ro.llk.enable true` enables llkd Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: If93bf9e981eaa3921a9da5f3160db26c4fe17e66 Merged-In: If93bf9e981eaa3921a9da5f3160db26c4fe17e66
2021-10-26Snap for 7856912 from 921307851b048efd11252abb48c395abbdcbf45d to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I33eba0ad0b965754b4e70296736916d929fb24e9
2021-10-26Merge "init.rc: Create a new group for dex2oat" into sc-v2-devTreeHugger Robot
2021-10-22init.rc: Create a new group for dex2oatRick Yiu
Create a new group for dex2oat in cpu cgroup, which is dedicated for dex2oat processes. Also modify task profiles for this change. Bug: 201223712 Test: dex2oat group created Change-Id: Ic61f4b8a64d01c03549b680970805e12b9ce4fcc Merged-In: Ic61f4b8a64d01c03549b680970805e12b9ce4fcc
2021-10-14Snap for 7824833 from 77b37c9f87582ebe5e515b8606b0e509edc729b3 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I5a9ab1c0cb775a8a9591fe83bc57545c191bb453
2021-10-14storageproxyd: discard writes when checkpointing, if necessary am: 98e7f427e8Thurston Dang
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/16049468 Change-Id: I8b0d1da6d516313b5e672bc3a6c0ea8075e01c17
2021-10-13Snap for 7821078 from cb1fabeff6b842d9f12265cc7962705f17ed9b33 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: Id8c6ea1c0b9322ea84197d6703fd066ac017870a
2021-10-13storageproxyd: discard writes when checkpointing, if necessaryThurston Dang
If a checkpointing operation is in progress, discard any write operations that are flagged as STORAGE_MSG_FLAG_PRE_COMMIT_CHECKPOINT. In tandem with trusty-side changes that set the flag appropriately, this avoids the awkward case where the checkpoint is rolled back, which potentially leads to inconsistency between the data and the superblock. Based on Stephen's CL/1845477 "Add helper to check checkpoint state of mounts". Original change: https://android-review.googlesource.com/c/platform/system/core/+/1850058 Test: m storageproxyd Bug: 194313068 Change-Id: I0924084f7f0b20018cbb71f5153469c8a686e262 Merged-In: I0924084f7f0b20018cbb71f5153469c8a686e262 (cherry picked from commit 34404f4ab1326eb179f889201dcfd04eb6002d0e)
2021-10-13Revert "Revert "init.rc: disable creation of bootreceiver tracing instance ↵Alexander Potapenko
for kernels >=4.9 and <= 5.4"" am: 0e28aeb786 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/16045538 Change-Id: I144596dbd34448300b027b7890c1929344aa89b5
2021-10-13Revert "Revert "init.rc: disable creation of bootreceiver tracing instance ↵Alexander Potapenko
for kernels >=4.9 and <= 5.4"" This reverts commit 220f604ca5f5b844b842a30fe40ad07dc570030f. Reason for revert: from bug 202436407 it looks like the initial revert wasn't needed. Change-Id: I81dba47ee4bc55da2d4c5212dfc1b6200719b8be
2021-10-09Snap for 7809322 from 4dc0b4e1cbccc22a33526af54f7e4aa7482d1f63 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I9a597470580a9cd7310299e38c59ae442e4a9314
2021-10-09Snap for 7806961 from f8c43a23bee6ef5010bff7a2412cfcd8d67ede17 to sc-d2-releaseAndroid Build Coastguard Worker
Change-Id: I221be30d139b1ee4320e6573bb0b52b00e72daa3
2021-10-08Merge "libutils: use system_background for low prio tasks in framework" into ↵Wei Wang
sc-qpr1-dev am: ecaf9ef70a Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15946148 Change-Id: I2094d7af01deb3ca3c8acd52da54e0849a8c0c73
2021-10-08task_profiles: add ServicePerformance to legacy device policy am: 276ba2c75bWei Wang
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/15998087 Change-Id: Iac66ba0d501e34679fefd259d3d1ee0306050d28
2021-10-08Merge "libutils: use system_background for low prio tasks in framework" into ↵Wei Wang
sc-qpr1-dev
2021-10-08task_profiles: add ServicePerformance to legacy device policyWei Wang
Since we are adding SCHED_SP_SYSTEM into framework, the policy is needed on older releases as well. Bug: 201428466 Test: Build Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I0784820bfec84fd8ef98f2feb2caee084d0a14a2 Merged-In: I0784820bfec84fd8ef98f2feb2caee084d0a14a2
2021-10-08Revert "init.rc: disable creation of bootreceiver tracing instance for ↵Chiayu Pei
kernels >=4.9 and <= 5.4" am: 220f604ca5 Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/16013258 Change-Id: Ifc9e3b5176bfc16b39800fe95abbb629372dfa42
2021-10-08Revert "init.rc: disable creation of bootreceiver tracing instance for ↵Chiayu Pei
kernels >=4.9 and <= 5.4" This reverts commit 4edda28b92aab6a795241045bb088d25fb623ed1. Reason for revert: b/202436407 Change-Id: I4cdbdb756b9fc61bb6f5ff61335fec7d541ec6a2
2021-10-07libutils: use system_background for low prio tasks in frameworkWei Wang
Bug: 201428466 Test: Build and boot check system_server's sched group Signed-off-by: Wei Wang <wvw@google.com> Change-Id: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c Merged-In: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c