Commit graph

78471 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
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
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
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
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
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
Sayanna Chandula
5754b5ab10 init: Support reboot reason with thermal warmreset
Thermal shutdown could be due to tskin temperature or
battery temperature. Pass reason while rebooting the
system to reflect properly in boot.reason

Bug: 238464124
Test: Build and boot on device. Check reboot reason
for thermal shutdown and battery thermal shutdown with
thermal warmreset enabled.

Change-Id: I192562fed48ae7da7843e383362cd22a76ce479f
2022-10-07 14:11:25 -07:00
Yi-Yo Chiang
ddc9763ee2 Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE
This variable is always false or empty now, so clean up remaining
references of the variable.

Bug: 241346584
Test: Presubmit
Change-Id: Id5c37a1391239206477fd802d364a2678692f513
2022-10-07 21:17:40 +08:00
Treehugger Robot
460f70bb52 Merge "Adding target (sdk-repo-platform-tools) that is used by gmac(sdk_mac) build." 2022-10-07 04:13:51 +00:00
Yi-yo Chiang
ae57e8da32 Merge "remount: Remove AVB 1.0 code & opaque exit code" 2022-10-07 03:47:03 +00:00
Shaju Mathew
6c27f235cf Adding target (sdk-repo-platform-tools) that is used by gmac(sdk_mac) build.
Bug: 249370316
Test: N/A (coastguard)

Signed-off-by: Shaju Mathew <shaju@google.com>
Change-Id: I641d4f8dc60652c7e8eaebafd905090d3c0324f2
2022-10-06 22:37:09 +00:00
Bob Badour
e2b1d3c846 Merge "Add LOCAL_LICENSE_KINDS to system/core" 2022-10-06 22:28:09 +00:00
Bob Badour
03d5052754 Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  init/fuzzer/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I2db55c80799d0a8fc5935d9b07a2ddb17eb7235e
2022-10-06 19:59:07 +00:00
Treehugger Robot
71d9f3607b Merge changes I264d0891,I1af733e7,Iae344c1e
* changes:
  Added init_ueventHandler_fuzzer
  Added init_property_fuzzer
  Added init_parser_fuzzer
2022-10-06 13:59:37 +00:00
Yi-Yo Chiang
ce2dbd009f remount: Remove AVB 1.0 code & opaque exit code
* Remove AVB 1.0 (fec).
* Assert device is bootloader unlocked in main().
* Since error is already logged to stderr and logd, there is no need to
  return an opaque enum value as error code. Just return 1 if main()
  encounters any error.

Bug: 241688845
Test: Presubmit
Test: adb-remount-test
Change-Id: I06df6f92a3d4adaca77061920736056c9051c112
2022-10-06 18:54:19 +08:00
Yi-yo Chiang
5653687caf Merge changes I8b5e08a3,Iccfe06f9
* changes:
  fs_mgr_overlayfs: Remove support for physical scratch
  fs_mgr_overlayfs: Refactor scratch mounting code
2022-10-06 06:19:12 +00:00
Wayne Ma
78e23f23ce Merge "Make libstatspull_bindgen available to resolv apex." 2022-10-06 01:28:18 +00:00
Thurston Dang
8ae1c1db42 storageproxyd: Add STORAGE_FILE_GET_MAX_SIZE API on Android side
This is the Android-side companion change to go/oag/2241573,
adding the interface for STORAGE_FILE_GET_MAX_SIZE (implementation
sold separately).

Bug: 247003431
Test: None
Change-Id: Ie834c91a085b2e4a668e0d9d22ec0f6b1e4e6c1c
2022-10-06 00:12:00 +00:00