summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-07Snap for 8417597 from 30c5added430079dfcf393e461b058329dc23734 to ↵android-12.1.0_r9android-12.1.0_r8android-12.1.0_r7android-12.1.0_r22android-12.1.0_r21android-12.1.0_r20android-12.1.0_r19android-12.1.0_r11android-12.1.0_r10android12-qpr3-s7-releaseandroid12-qpr3-s6-releaseandroid12-qpr3-s5-releaseandroid12-qpr3-s4-releaseandroid12-qpr3-s3-releaseandroid12-qpr3-s2-releaseandroid12-qpr3-s1-releaseandroid12-qpr3-releaseAndroid Build Coastguard Worker
sc-qpr3-release Change-Id: I0ab15c0688b674775b075d41fec9ee0f2fadc09c
2022-04-07[automerger skipped] Backport of Win-specific suppression of potentially ↵Shaju Mathew
rogue construct that can engage am: c3483e4c8a am: 07995227fe -s ours am: b446f13c58 -s ours am: b0bae04b87 -s ours am skip reason: Merged-In Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d with SHA-1 efe701798b is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17586924 Change-Id: If3a24cff2e54cb9ae2465f39c59adbed0aad7d4a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-07[automerger skipped] Backport of Win-specific suppression of potentially ↵Shaju Mathew
rogue construct that can engage am: 505eeb7699 -s ours am: 568e58c468 -s ours am: 6a1ec98255 -s ours am skip reason: Merged-In Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d with SHA-1 efe701798b is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17605899 Change-Id: If9fe98541a8504f729dc03b91670709d0342e122 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06[automerger skipped] Backport of Win-specific suppression of potentially ↵Shaju Mathew
rogue construct that can engage am: c3483e4c8a am: 07995227fe -s ours am: b446f13c58 -s ours am skip reason: Merged-In Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d with SHA-1 efe701798b is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17586924 Change-Id: I2dc27f6e8b7b78bb5df0ac2fb8489cf2ae2a1d19 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06[automerger skipped] Backport of Win-specific suppression of potentially ↵Shaju Mathew
rogue construct that can engage am: 505eeb7699 -s ours am: 568e58c468 -s ours am skip reason: Merged-In Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d with SHA-1 efe701798b is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17605899 Change-Id: If82200cbb3b6eb282ceb3858a4d8fdf63746da51 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06[automerger skipped] Backport of Win-specific suppression of potentially ↵Shaju Mathew
rogue construct that can engage am: c3483e4c8a am: 07995227fe -s ours am skip reason: Merged-In Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d with SHA-1 efe701798b is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17586924 Change-Id: I9ceb48007785df3606044cd385034a41f3055796 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06[automerger skipped] Backport of Win-specific suppression of potentially ↵Shaju Mathew
rogue construct that can engage am: 505eeb7699 -s ours am skip reason: Merged-In Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d with SHA-1 efe701798b is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17605899 Change-Id: Ibeafe5fa6802b1d27aeeb7fb60405a834db9988d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-06Backport of Win-specific suppression of potentially rogue construct that can ↵Shaju Mathew
engage am: c3483e4c8a Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17586924 Change-Id: I96edd4b89c33fc2c68a0aa562bca23645fbf9796 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-05Backport of Win-specific suppression of potentially rogue construct that can ↵Shaju Mathew
engage in directory traversal on the host. Bug:209438553 Ignore-AOSP-First: Resolution for potential security exploit. Test: Cursory test with adb. Change-Id: Id47c567ad92ae4d9d7325a7a8589825a2ff4232b Merged-In: Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d
2022-04-05Backport of Win-specific suppression of potentially rogue construct that can ↵Shaju Mathew
engage in directory traversal on the host. Bug:209438553 Ignore-AOSP-First: Resolution for potential security exploit. Test: Cursory test with adb. Change-Id: Id47c567ad92ae4d9d7325a7a8589825a2ff4232b Merged-In: Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d
2022-03-19Snap for 8320190 from 9172a458e2238653038628fe967ce4a8f92b8613 to ↵Android Build Coastguard Worker
sc-qpr3-release Change-Id: I1239969a4da6496ee944b4a1781dc936b7734d07
2022-03-18Merge "storageproxyd: Use alternate data path if in DSU state" into sc-v2-devArmelle Laine
2022-03-10Snap for 8282142 from b84ce06c22bb44553f628eab84e8c6c1c954fa3d to ↵Android Build Coastguard Worker
sc-qpr3-release Change-Id: I516b5ed1293d6ad7fa28a582f96d022fcf4c6d31
2022-03-09[automerger skipped] init: Wait for snapuserd before starting second stage ↵Akilesh Kailash
am: 36a78b8e75 -s ours am skip reason: Merged-In I86c2de977de052bfe9dcdc002dcbd9026601d0f3 with SHA-1 65f3d09445 is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17062063 Change-Id: If42f01b39f2554690d67f854afd5cb3e0373095a
2022-03-09[automerger skipped] libprocessgroup: Use WriteStringToFd for ↵Rick Yiu
WriteFileAction am: 1458350370 -s ours am skip reason: Merged-In Id79f9e1095f52079393c58edb9a4d526f4cc6b5e with SHA-1 e808841d72 is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17061322 Change-Id: I7411b6d2e01d6758a0da438f705d405878b252aa
2022-03-09[automerger skipped] libprocessgroup: Prevent error spam when tests disable ↵Suren Baghdasaryan
all cpus in a cpuset am: ea98b60b86 -s ours am skip reason: Merged-In Ia91d8839d86787569c255481bde077be51c43d93 with SHA-1 ae42d601d0 is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/17061321 Change-Id: I120f08efcdad267864a91e4e758efed88d766ab6
2022-03-02init: Wait for snapuserd before starting second stageandroid-cts-12.1_r2Akilesh 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> (cherry picked from commit 65f3d09445699910947fd73b35979121b2bf07fb) (cherry picked from commit 7043054dfee9e29cd9a77903d7d63ed2a07e1707) Merged-In: I86c2de977de052bfe9dcdc002dcbd9026601d0f3 Change-Id: I86c2de977de052bfe9dcdc002dcbd9026601d0f3
2022-03-02libprocessgroup: 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 (cherry picked from commit e808841d72816c68da3d6d9f451aba71bf4188bc) (cherry picked from commit b8d7ac60bdeca738346b61a1b84be34f0072af2f) Merged-In: Id79f9e1095f52079393c58edb9a4d526f4cc6b5e Change-Id: Id79f9e1095f52079393c58edb9a4d526f4cc6b5e
2022-03-02libprocessgroup: 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> (cherry picked from commit ae42d601d09fa32b5c33758432cbd306b60f58ee) (cherry picked from commit 48e692cecd21059c9e94b9a399b96056f3b66289) Merged-In: Ia91d8839d86787569c255481bde077be51c43d93 Change-Id: Ia91d8839d86787569c255481bde077be51c43d93
2022-01-27Snap for 8119866 from 672cae47e9ca9318a684d431efa3087810f8fbd8 to ↵Android Build Coastguard Worker
sc-qpr3-release Change-Id: I65955ff1edf5b7275038724ae3cad697febc3349
2022-01-26storageproxyd: Use alternate data path if in DSU stateStephen Crane
Adds a check for a DSU mode boot in storageproxyd. Changes path handling so that storageproxyd will not allow opening a file in the root data path in DSU mode. Instead, storageproxyd creates an "alternate/" directory in the data directory and the TA must use this directory to store its backing file. Re-landing reverted change: Iad68872dc6915f64eaf26cd3c92c04d9071ef169 Test: Boot into DSU and inspect logs for "Cannot open root data file" Test: Test that TD writes in DSU mode don't corrupt host image storage when using a compatible storage TA that supports alternate data mode. Bug: 203719297 Merged-In: I1d07e7c3d15dc1beba2d340181d1b11a7988f869 Change-Id: I1d07e7c3d15dc1beba2d340181d1b11a7988f869
2022-01-26Merge changes from topic "SetProcessProfilesCached" into sc-v2-devSuren Baghdasaryan
* changes: init.rc: Set permissions to cgroup.procs files libprocessgroup: Add fd caching support for SetProcessProfiles libprocessgroup: Move fd caching code into FdCacheHelper
2022-01-26Snap for 8116027 from 8d3065db3cc3e5eda439b760fc826c73948fcf67 to ↵Android Build Coastguard Worker
sc-qpr3-release Change-Id: I79862e8ab0d273ff2937a854ca11cddb2a8bed66
2022-01-25init: 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
2022-01-25init.rc: Set permissions to cgroup.procs filesSuren Baghdasaryan
Set permissions to cgroup.procs files in cgroup hierarchies similar to permissions for tasks files so that SetProcessProfiles can access them. Bug: 215557553 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: Id0c82288392146c8d536d273790a0252580c4203 Merged-In: Id0c82288392146c8d536d273790a0252580c4203
2022-01-25libprocessgroup: Add fd caching support for SetProcessProfilesSuren Baghdasaryan
Process profiles operating on paths that do not depend on pid or uid of the process can cache the fd of the file they are operating on. Add support for fd caching similar to how SetTaskProfiles caches the fd of the file it needs to write to. Bug: 215557553 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: Ie73ebcbbf1919d90409f40c1f6b08743f4edf97c Merged-In: Ie73ebcbbf1919d90409f40c1f6b08743f4edf97c
2022-01-25libprocessgroup: Move fd caching code into FdCacheHelperSuren Baghdasaryan
Refactor file descriptor caching code and move it into FdCacheHelper because later on when we introduce fd caching for SetProcessProfiles the children of CachedFdProfileAction become different enough that sharing the same parent becomes a hindrance. Bug: 215557553 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: If3812a0090c81a29e25f0888b0511cfaf48edea3 Merged-In: If3812a0090c81a29e25f0888b0511cfaf48edea3
2022-01-21[DO NOT MERGE] Allow to run fsck.f2fs in first_stage_ramdiskJaegeuk Kim
[ 23.065933][ T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/sda8 [ 23.067470][ T1] logwrapper: Cannot log to file /dev/fscklogs/log [ 23.067829][ T1] logwrapper: [ 23.068997][ T332] logwrapper: executing /system/bin/fsck.f2fs failed: Permission denied [ 23.069759][ T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: Permission denied [ 23.071659][ T332] logwrapper: [ 23.083283][ T1] fsck.f2fs: fsck.f2fs terminated by exit(255) [ 23.083283][ T1] [ 23.111166][ T1] F2FS-fs (sda8): Found nat_bits in checkpoint [ 23.121242][ T1] F2FS-fs (sda8): Mounted with checkpoint version = 6a65cb64 [ 23.121831][ T1] init: [libfs_mgr]__mount(source=/dev/block/platform/14700000.ufs/by-name/metadata,target=/metadata,type=f2fs)=0: Success Bug: 210589189 Bug: 214203920 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: I720e2aa4b1ab845af96610cd0d9c6e3c9b4cae03 Merged-In: Change-Id: I720e2aa4b1ab845af96610cd0d9c6e3c9b4cae03
2022-01-21[DO NOT MERGE] Mount /mnt/scracth with -o sync,nodiscardJaegeuk Kim
"-o discard" issues UNMAP commands to loopback resulting in punch_hole on the pinned file in /data. That will break the pinned block map. Bug: 210589189 Bug: 214203920 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: Ia927c43fc75164ce5929173f5740737eac4de484 Merged-In: Ia927c43fc75164ce5929173f5740737eac4de484
2022-01-21[DO NOT MERGE] Run check_fs only /data is mountedJaegeuk Kim
After switching to /system from ramdisk, first_stage_init has no required libraries for check_fs. [ 20.838811][ T1] init: [libfs_mgr]Created logical partition scratch on device /dev/block/dm-6 [ 20.972704][ T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/dm-6 [ 20.977879][ T345] logwrapper: executing /system/bin/fsck.f2fs failed: No such file or directory [ 20.978470][ T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: No such file or directory [ 20.981137][ T1] fsck.f2fs: fsck.f2fs terminated by exit(255) [ 21.002958][ T1] init: [libfs_mgr]__mount(source=/dev/block/dm-6,target=/mnt/scratch,type=f2fs)=0: Success [ 21.017748][ T1] init: [libfs_mgr]umount(/mnt/scratch) [ 21.021028][ T1] init: [libfs_mgr]Running /system/bin/fsck.f2fs -a -c 10000 --debug-cache /dev/block/dm-6 [ 21.028759][ T347] logwrapper: executing /system/bin/fsck.f2fs failed: No such file or directory [ 21.028793][ T1] fsck.f2fs: executing /system/bin/fsck.f2fs failed: No such file or directory [ 21.049100][ T1] fsck.f2fs: fsck.f2fs terminated by exit(255) [ 21.068101][ T1] init: [libfs_mgr]__mount(source=/dev/block/dm-6,target=/mnt/scratch,type=f2fs)=0: Success Bug: 210589189 Bug: 214203920 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: Ie41cba4e7553860fdb48996d9b58a34093f0b723 Merged-In: Ie41cba4e7553860fdb48996d9b58a34093f0b723
2022-01-21[DO NOT MERGE] Don't use FSCK_LOG_FILE used for ext4 onlyJaegeuk Kim
Bug: 210589189 Bug: 214203920 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: Iaf7a61c6c9c6cd557f953b1a665e7a1640d357ae Merged-In: Iaf7a61c6c9c6cd557f953b1a665e7a1640d357ae
2022-01-21[DO NOT MERGE] Don't try to mount if the disk has no FS magicJaegeuk Kim
This avoids: [ 22.932529][ T1] init: [libfs_mgr]Invalid f2fs superblock on '/dev/block/platform/14700000.ufs/by-name/metadata' [ 22.934609][ T1] F2FS-fs (sda8): Magic Mismatch, valid(0xf2f52010) - read(0x0) [ 22.935061][ T1] F2FS-fs (sda8): Can't find valid F2FS filesystem in 1th superblock [ 22.937306][ T1] F2FS-fs (sda8): Magic Mismatch, valid(0xf2f52010) - read(0x0) [ 22.943700][ T1] F2FS-fs (sda8): Can't find valid F2FS filesystem in 2th superblock [ 22.951937][ T1] init: [libfs_mgr]__mount(source=/dev/block/platform/14700000.ufs/by-name/metadata,target=/metadata,type=f2fs)=-1: Invalid argument Bug: 210589189 Bug: 214203920 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: I27989b25769eae83eb06ac86146f27baf288b7e1 Merged-In: I27989b25769eae83eb06ac86146f27baf288b7e1
2022-01-21[DO NOT MERGE] Retry to unmount /dataRandall Huang
If we fail to umount /data, device won't boot up at all. Bug: 208161227 Bug: 214203920 Signed-off-by: Jaegeuk Kim <jaegeuk@google.com> Change-Id: I92d34a253039eb677d4df9fad8a0821fbc684f57 Merged-In: I92d34a253039eb677d4df9fad8a0821fbc684f57
2022-01-21Snap for 8099527 from ae5fe46ece70b797206cef277c6f19dcf7ec5539 to ↵Android Build Coastguard Worker
sc-qpr3-release Change-Id: I0d7fbbc771621ba6d75949f40b1b9a2e9e9cc9ed
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-19Snap for 8090301 from 71429a9738471920772df0d5d50a820aa0d50fbe to ↵Android Build Coastguard Worker
sc-qpr3-release Change-Id: I86c910ecf926bfa3be1ed20b9ef6781dde5723c0
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-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-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-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-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-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