Commit graph

78684 commits

Author SHA1 Message Date
Akilesh Kailash
e8f6a126fb libsnapshot: Refactor code
Move all files related to libsnapshot_cow library to
a seperate directory. Libsnapshot directory is getting
crowded and we will be adding more files to this library
with async writes.

No changes to any logic.

Bug: 254188450
Test: Full OTA on Pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: If84ff730d477c85a8ef57864d2185f2f897cf8e0
2022-10-18 16:48:33 +00:00
Elliott Hughes
06a839fc77 Remove an obsolete workaround.
Bug: http://b/29412086
Test: treehugger
Change-Id: I3a61db8da234b4c150816af264d796da7dfe0af6
2022-10-18 16:31:04 +00:00
Bart Van Assche
a2c160449b init: Introduce Epoll::SetFirstCallback()
Prepare for optimizing Epoll::Wait() by moving the
ReapAnyOutstandingChildren() call into Epoll::Wait(). No functionality
is changed.

Bug: 213617178
Change-Id: I280ea0069ed29cf323e4177ec500b30b900f7c8d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-10-18 09:17:55 -07:00
Bart Van Assche
20954a8e34 init/epoll_test: Improve this test
Add a move constructor in the CatchDtor class. Check the .emplace()
result. Simplify the destructor. Initialize handler_invoked. Explain the
purpose of this test.

Bug: 213617178
Change-Id: I4d6f97dbb2705a2f2dd78e449ae8de74e90b102f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-10-18 09:17:55 -07:00
Treehugger Robot
3ea0f312f5 Merge "Use ro.product.vendor.device to determine if running on Cuttlefish" 2022-10-18 11:07:50 +00:00
Yi-yo Chiang
956a45485a Revert "fs_mgr_overlayfs: Revert to use /data only if VAB"
This reverts commit c540ab9bf8.

Reason for revert: root cause is fixed

Bug: 253207748
Test: TH run g3-app-compat-main
Change-Id: I44c2535508a5718a823cdd61ad1938bba739c2a0
2022-10-18 09:43:20 +00:00
Yi-yo Chiang
eb88e7b677 Use ro.product.vendor.device to determine if running on Cuttlefish
Similar reasoning as aosp/2255456. ro.product.device could be overridden
by GSI if system.img was replaced with GSI.
Use ro.product.vendor.device, which comes from the vendor.img, to
determine the "device" type.

Bug: 243116800
Test: adb-remount-test on cuttlefish
Change-Id: Ib4a956047ef46d8e4837b27334f8d58162d4fa2a
2022-10-18 07:34:45 +00:00
Yi-yo Chiang
e7f5532e0a Merge "fs_mgr_overlayfs: Add scratch size override system property" 2022-10-18 06:56:24 +00:00
Treehugger Robot
2d7765c80c Merge "riscv64 has no "other" to need an sepolicy." 2022-10-17 23:29:49 +00:00
Elliott Hughes
356e83b23f riscv64 has no "other" to need an sepolicy.
Fixes
```
out/soong/installs-aosp_riscv64.mk:56833: error: overriding commands for target `out/target/product/generic_riscv64/system/etc/seccomp_policy/crash_dump.riscv64.policy', previously defined at out/soong/installs-aosp_riscv64.mk:56829
```

Test: m
Change-Id: I78a1c6b10dac2da704515f33b492ff37cc086dd6
2022-10-17 21:42:32 +00:00
Evgenii Stepanov
4a93612db3 Merge "Harden CrasherTest::Trap under sanitizers." 2022-10-17 20:47:31 +00:00
Treehugger Robot
37b878dcea Merge "overlayfs: use overlayfs for f2fs readonly mode" 2022-10-17 20:18:29 +00:00
Jaegeuk Kim
c114177985 overlayfs: use overlayfs for f2fs readonly mode
F2FS doesn't allow remount,rw for RO partition, so that it caused adb remount.
Fix it.

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ia4410d08e8be344d79292c16a335a7e5be7a48bb
2022-10-17 11:38:45 -07:00
Elliott Hughes
cfd803d5f5 Merge "Add tomstone proto support for riscv64" 2022-10-14 21:58:57 +00:00
Elliott Hughes
b9801d82e6 Merge "Add seccomp policy for riscv64 crash_dump" 2022-10-14 21:58:46 +00:00
Colin Cross
0e6641a9ce Merge "Disable code_coverage.other for riscv64" 2022-10-13 23:47:49 +00:00
Evgenii Stepanov
361455eb37 Harden CrasherTest::Trap under sanitizers.
The use of __builtin_abort in CrasherTest::Trap breaks with
-ftrap-function=abort, because then the argument of Trap is no longer in
the first argument register at the time of crash.

This flag is added when *any* sanitizer is enabled on the target, even harmless
ones like memtag-heap. See sanitize.go:769.

Fix CrasherTest::Trap to be a little more reliable.

Test: debuggerd_test with SANITIZE_TARGET=memtag_heap
Change-Id: I150f1c0355bd6f2bfabfa5a7bba125acdde1120e
2022-10-13 16:40:05 -07:00
Colin Cross
83fc3048d6 Disable code_coverage.other for riscv64
code_coverage.policy.other is supposed to install a policy for the
"other" architecture, e.g. arm for arm64.  riscv64 doesn't have an
"other" architecture, disable the module.

Test: builds
Change-Id: Ic42c706dd9c1efe4b0fe9fa7c9823a2a379ba56b
2022-10-13 13:49:10 -07:00
Tri Vo
ce223a5c6f Trusty IRemotelyProvisionedComponent v3 HAL implementation
Bug: 235265072
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: If0ea94710d0d0e18020a0a4b9c05ef915bbf61fa
2022-10-13 13:40:38 -07:00
Treehugger Robot
862f8b158c Merge "Fix bug in WriteStringToFileAtomic" 2022-10-13 18:25:18 +00:00
Treehugger Robot
29752d276e Merge "libprocessgroup: Improve error messages" 2022-10-13 16:49:18 +00:00
Kelvin Zhang
7e05c04432 Fix bug in WriteStringToFileAtomic
According to https://www.slideshare.net/nan1nan1/eat-my-data ,
rename() without an fsync() is not safe, and cannot guarantee data
integrity in case of powerloss of OS failure.

Test: partner verification, th
Bug: 238702018
Change-Id: I5809770062ed7bfa47df81de418a2d8f7cbc6620
2022-10-13 09:43:44 -07:00
Elliott Hughes
5a6834b441 Merge "Add riscv64 support for debuggerd/crasher" 2022-10-13 16:12:47 +00:00
Rajesh Nyamagoud
9f22d4f8cf Changes to adapt confirmationui AIDL spec.
Replaced HIDL spec implementation with AIDL spec in confirmationui
module.

Ignore-AOSP-First: Dependent on internal change.
Bug: b/205760172
Test: Run confirmation UI test using CTS Verifier, atest VtsHalConfirmationUITargetTest
Change-Id: I49b9cb6d93fa35fd611003f7545d2ce4976eec7c
2022-10-13 15:17:34 +00:00
Jooyung Han
b08709fa63 Add libconnectivity_native
The library provides an interface to interface with the
ConnectivityNative service, and implement port blocking APIs.

Bug: 179733303
Test: atest connectivity_native_test
Change-Id: I86018bfeb60d031faee818e5df469f02ebe32707
2022-10-13 12:47:16 +09:00
Tri Vo
ad4ecd962c Merge "Implement getHardwareInfo() in Trusty KM TA" 2022-10-12 22:53:43 +00:00
Liu Cunyuan
8c0101b971 Add tomstone proto support for riscv64
Signed-off-by: Liu Cunyuan <liucunyuan.lcy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: Ie22c2895fc30fab68eddc18713c80e403f44b203
2022-10-12 22:31:45 +00:00
Chen Guoyin
a22af66e4b Add seccomp policy for riscv64 crash_dump
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: Ie58bd7cf5dde792d8fba78602b5f53471752ab24
2022-10-12 22:31:39 +00:00
Xia Lifang
b13a10bb5d Add riscv64 support for debuggerd/crasher
Signed-off-by: Xia Lifang <lifang_xia@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I521c6da61cf2f6f67a73febf368068c430d94cdb
2022-10-12 22:30:27 +00:00
Elliott Hughes
ef8ea8f9f6 Merge changes I840cce02,I3dbe6b6d
* changes:
  Add code_coverage seccomp policy for riscv64
  Add riscv64 support for libcutils
2022-10-12 21:58:56 +00:00
Bart Van Assche
7a952617f6 libprocessgroup: Improve error messages
Change two PLOG() statements into LOG() statements since PLOG() should
only be used if errno has been set. Make it easier to find the code that
logs an error message.

Bug: 213617178
Signed-off-by: Bart Van Assche <bvanassche@google.com>
Change-Id: I73443f3adb7d7ba3fc0d39a55777f0b132529fbd
2022-10-12 13:48:52 -07:00
Tri Vo
025b7f3cd8 Implement getHardwareInfo() in Trusty KM TA
Bug: 253109915
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I579d563759a3af97100da95dab6a99ca52d0b384
2022-10-12 10:35:49 -07:00
Chen Guoyin
0d77b388f5 Add code_coverage seccomp policy for riscv64
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I840cce02a087d05587bfa61824e9071732c16218
2022-10-12 22:22:09 +08:00
Liu Cunyuan
46ed34b68f Add riscv64 support for libcutils
Signed-off-by: Liu Cunyuan <liucunyuan.lcy@linux.alibaba.com>
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Change-Id: I3dbe6b6d79c2655ab76f48e48fd22ab72d761dfd
2022-10-12 22:16:41 +08:00
Yi-Yo Chiang
15f94436b3 fs_mgr_overlayfs: Add scratch size override system property
Bug: 253207748
Test: Treehugger
Change-Id: I7140044d127e7db99d86decbe818be3680d26995
2022-10-12 20:23:19 +08:00
Yi-yo Chiang
cf10e2097d Merge "Replacing fs_mgr_dir_is_writable(work) with fs_mgr_rw_access(work) to check whether the scratch partition is writable." 2022-10-12 10:06:48 +00:00
yi.sun
301adfcc07 Replacing fs_mgr_dir_is_writable(work) with fs_mgr_rw_access(work) to
check whether the scratch partition is writable.

Delate fs_mgr_dir_is_writable, as it may cause remount to fail.

Steps to reproduce:
1.adb root
2.adb remount
3.adb reboot
4.adb remount
5.push files to the system partition until the scratch partition is full
6.check that the Available of /mnt/scratch is zero through the df command
7.reboot
8.adb root
9.adb remount
Now, overlayfs failed to mount.

But I want to continue to view the files that were previously pushed to
the system partition.
Mounting of overlayfs should not be blocked when there is not enough space.
It seems reasonable to use fs_mgr_rw_access(work) to check whether
the partition is writable.
We should allow mount even if scratch is full, because this allows
the user to delete previously pushed files to free up space.

Bug: 240635368
Change-Id: I726ccd064cfabfab29789e7c690ea8cb574a6344
Signed-off-by: yi.sun <yi.sun@unisoc.com>
2022-10-12 03:06:22 +00:00
Thurston Dang
aa9eb7c87a Merge "storageproxyd: Add STORAGE_FILE_GET_MAX_SIZE API on Android side" 2022-10-12 00:27:03 +00:00
Akilesh Kailash
889b446810 Merge "init: Detach daemon only after sepolicy is loaded" 2022-10-11 21:04:42 +00:00
Yi-yo Chiang
9b123de886 Merge "Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE" 2022-10-11 10:31:19 +00:00
Treehugger Robot
f9ad588898 Merge "fs_mgr_overlayfs: Revert to use /data only if VAB" 2022-10-11 09:44:31 +00:00
Treehugger Robot
8b70bc46fb Merge "wear: add libicu to list of public libraries" 2022-10-11 07:05:11 +00:00
Yi-yo Chiang
c540ab9bf8 fs_mgr_overlayfs: Revert to use /data only if VAB
Partial revert of aosp/2240456 to fix b/251472189

Bug: 251472189
Test: Treehugger
Test: adb-remount-test
Test: g3-app-compat-main
Change-Id: Ifbd608a249fdc599954c34a134ef8497fdf24b46
2022-10-11 05:27:44 +00:00
Christopher Ferris
4fb3712462 Modify the mmc data structure.
The new 6.0 kernel headers changed all variable length
structures from [0] to []. This causes a clang warning to
trigger, so rewrite the mmc data structures using a union
to avoid having a variable sized array in the middle of the
structure.

Test: Builds.
Change-Id: Ib1ac92c4f76af386d934f51a3c73cb8914e97624
2022-10-10 15:26:10 -07:00
Akilesh Kailash
035e557fd3 init: Detach daemon only after sepolicy is loaded
The new sequence of operation would be:

1: Load sepolicy - Daemon will continue to be alive and serve any I/O request

2: After sepolicy loading is complete - Switch the device-mapper tables.

3: Kill the block device daemon launched in the first-stage init.

4: Re-launch the daemon with the correct selinux labels set.

5: Enforce the sepolicy

Bug: 240321741
Test: Full OTA on pixel
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Idd392f0f0aae7d93e546c0ec0762e6c07b6263e4
2022-10-10 21:58:52 +00:00
Steven Moreland
b9d8e8289e Merge changes I732e5b8a,I4271909e
* changes:
  libutils: RefBase DEBUG_REF love
  libutils: DEBUG_* modes compile forever
2022-10-10 20:40:35 +00:00
Steven Moreland
b7412c8cd6 libutils: RefBase DEBUG_REF love
Done here:
- path saved to a useable location on host
- path always printed (for visibility for new users)
- open(.., 666) - That's '01204' not '0644' oops

Future considerations:
- make defines constexpr instead of ifdef
- copy malloc hook design to avoid needing to recompile code
- make libutilscallstack default on host
- run libutils tests, not just test compile debug mode
- code incorrectly prints ref 'doesn't exist'
  seems it's gotten out of sync, but still good enough
  to use stacktraces

Bug: 244325464
Test: manual
Change-Id: I732e5b8aec3cd946ef3559a2a814caf693846cc0
2022-10-10 16:58:57 +00:00
Ludvig Hansson
f2435108ce wear: add libicu to list of public libraries
Bug: 250668939
Test: atest CtsIcu4cTestCases:Icu4cGTests

Change-Id: I3348171dbbe5c22f601427de763109e02bd7e913
2022-10-10 14:56:20 +00:00
Sayanna Chandula
1d0fec78c4 Merge "init: Support reboot reason with thermal warmreset" 2022-10-08 15:47:35 +00:00
Steven Moreland
377adea81c libutils: DEBUG_* modes compile forever
I've seen these fixed before, so we compile the debug modes
now.

Bug: 244325464
Test: 'm libutils_test_compile'
Change-Id: I4271909e81893ad448bc46b8a3a567a84c40f8a3
2022-10-08 05:13:47 +00:00