Commit Graph

59638 Commits

Author SHA1 Message Date
hyeeun.jun@samsung.com 612fc47090 Fix Deadlock Issue On AppFuseBridge
There are two locks used by AppFuseBridge.
First is it's object lock, and the second is a mutex lock in app fuse library.
There are two oppsite routines to get those locks.

  (Thread A) Got Java lock -> Try to get Native lock
  (Thread B)        Got Native lock -> Try to get Java lock

The order must be followed to obtain two locks.
If not, the dead lock will be caused.
Therefore we change the routine to get the mutex lock first, and the object lock later.

Signed-off-by: hyeeun.jun@samsung.com <hyeeun.jun@samsung.com>
Bug: https://issuetracker.google.com/issues/145707568
Bug: 157535024
Test: atest --test-mapping apex/blobstore

Change-Id: I0ab002da9a0b7ca2f518d50ab477a080cabe3788
2020-06-17 13:39:21 +01:00
android-build-team Robot 2a613052e0 Make change and version bump to r_aml_300801800 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I67412c29ed3bd211cd34196b5685d8750c37de6c
2020-06-17 07:17:09 +00:00
Tom Cherry d4806c635a fsmgr: fix integer overflow in fs_mgr am: e28dc48de5
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11882481

Change-Id: Iade7ea2ae1b606af1418053b68b00e3d25fcd155
2020-06-17 00:19:17 +00:00
Tom Cherry e28dc48de5 fsmgr: fix integer overflow in fs_mgr
As the EXT4_MAX_BLOCK_SIZE defined as 65536 which reached maxium value
of unsigned int. The superblock value maybe larger than 65536. This is
found by the Integer Overflow Sanitizer.

This patch fixed below boot error when userdata is corrupted:
init: processing action (fs) from
(/vendor/etc/init/hw/init.freescale.rc:221)
init: [libfs_mgr]Invalid ext4 superblock on '/dev/block/by-name/userdata'
init: InitFatalReboot: signal 6 init: #00 pc 00000000000af7e8  /system/bin/init
(android::init::InitFatalReboot(int)+208) init: #01 pc 00000000000afbd0  /system/bin/init
(android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+32)
init: #02 pc 00000000000006bc  [vdso:0000ffff9691b000] (__kernel_rt_sigreturn)
init: #03 pc 000000000004e070  /system/lib64/bootstrap/libc.so (abort+176)
init: #04 pc 000000000003427c  /system/lib64/libfs_mgr.so
(read_ext4_superblock(std::__1::basic_string<char, std::__1::char_
traits<char>, std::__1::allocator<char> > const&,
android::fs_mgr::FstabEntry const&, ext4_super_block*, int*)+1804)

Test: boot with corrupted ext4 superblock
Bug: 156200421

Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
Change-Id: Ib1b69bf4623f69696cb637b226ec3359fc2ed409
(cherry picked from commit cb472b92e5)
2020-06-16 23:32:39 +00:00
android-build-team Robot 157a105d46 Make change and version bump to r_aml_300801700 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Ia721a85c7321b1316ef186221edd2f9f49c552f9
2020-06-16 07:15:04 +00:00
Yifan Hong 9f5f5feeb0 libsnapshot_test: hardcode alignment. am: 755eb6b606
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11870537

Change-Id: I768ca328300d5e741f25bbe45106ca9bffc2d00c
2020-06-15 23:50:33 +00:00
Yifan Hong 755eb6b606 libsnapshot_test: hardcode alignment.
SnapshotUpdateTest uses a relatively small super partition, which
requires a small alignment and 0 alignment offset to work. For the
purpose of this test, hardcode the alignment and offset.
This test isn't about testing liblp or libdm.

Fixes: 154355449
Fixes: 157437632
Bug: 158718136
Bug: 157633441
Bug: 154646936

Test: atest on devices with alignment of data partition >= 512KiB

Change-Id: I1d0474f028cc824bd4197d0228350395239b3b81
(cherry picked from commit 31739669e91c7a3afc5bee23e43bc45fb4154667)
Merged-In: I1d0474f028cc824bd4197d0228350395239b3b81
2020-06-15 14:00:12 -07:00
android-build-team Robot ec54be6082 Make change and version bump to r_aml_300801600 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I85ad9bdcb8d2bb3a24e1664b9ba3280b1a540cb9
2020-06-15 07:15:15 +00:00
android-build-team Robot 42f32a6bd1 Make change and version bump to r_aml_300801500 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Ic2c480c0922ac22ab9d2ef8420555d7722d6f2ab
2020-06-14 07:20:18 +00:00
Randall Huang 1c73e42706 Try to recover corrupted ext4 /data with backup superblock am: 4e864e1216
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11835152

Change-Id: I53521b29b855ba03ff126be73690fd3c0a4d75d7
2020-06-12 17:33:05 +00:00
android-build-team Robot f46bbc5609 Make change and version bump to r_aml_300801400 for mainline module file: adb/apex/apex_manifest.json
Change-Id: If42da0d917943a6f207d293e846f7fd6e94f1481
2020-06-12 07:20:00 +00:00
Randall Huang 4e864e1216 Try to recover corrupted ext4 /data with backup superblock
If the superblock of /data is corrupted, fs_mgr would skip check_fs.
But, e2fsck actually may reference backup superblock to recover
the filesystem. This fix gives fs_mgr second chance to fix corrupted
ext4 /data.

Bug: 156200421
Test: boot with corrupted ext4 superblock

Signed-off-by: Randall Huang <huangrandall@google.com>
Change-Id: Ieb89e7274d772962fe37927dcd62567dd5aa4657
(cherry picked from commit 72abd7b246)
2020-06-12 02:07:35 +00:00
TreeHugger Robot 9b3d27f4d8 Merge "liblp: Remove tests for alignment_offset being 0." into rvc-dev am: 2d51d38224
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11817320

Change-Id: I426268cbbd9da005eefa7fbfe85613f393f532ce
2020-06-11 19:28:26 +00:00
TreeHugger Robot 2d51d38224 Merge "liblp: Remove tests for alignment_offset being 0." into rvc-dev 2020-06-11 19:17:55 +00:00
Ruchir Rastogi 203abd116b Merge "Do not truncate AStatsEvent buffers" into rvc-dev am: 172562dc90
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11832292

Change-Id: I8fdb0174485233b57e93861c7c193d47f5d09b12
2020-06-11 18:12:04 +00:00
Ruchir Rastogi 172562dc90 Merge "Do not truncate AStatsEvent buffers" into rvc-dev 2020-06-11 17:57:06 +00:00
android-build-team Robot 3bb237b409 Make change and version bump to r_aml_300801300 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I62b89c36bf58a535f519b32e62340be5a8aa1f1a
2020-06-11 07:14:55 +00:00
Ruchir Rastogi f2a5ed081a Do not truncate AStatsEvent buffers
Pushed atoms do not need to be truncated because only the bytes added to
the buffer are written to the socket. Pulled atoms do not need to be
truncated because within stats_pull_atom_callback.cpp, we only copy the
valid parts of the buffer to the StatsEventParcel object.

This improves performance by avoiding a needless call to realloc.

+ removed dead benchmarking code

Test: m libstatssocket
Test: atest libstatssocket_test
Test: atest GtsStatsdHostTestCases
Bug: 158717786
Change-Id: I6965f8832758203ca566336ba12d0acaf5f756d5
2020-06-10 20:43:53 -07:00
David Anderson a5f8e50fbb liblp: Remove tests for alignment_offset being 0.
This test doesn't exist on AOSP anymore, and the bugs around
alignment_offset have been fixed in R. There is no need for the test
anymore.

Bug: 157398966
Test: liblp_test gtest
Change-Id: I00ac7486faf8db8b18f764e61db1d545feb0312c
Merged-In: I563122282e940e07a7ece97ed1a9846ad1f3253c
2020-06-11 03:25:28 +00:00
TreeHugger Robot 274cb15635 Merge "Fine tune blkio setting to improve boot time" into rvc-dev am: c39f708cb4
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11759320

Change-Id: Ib523666d76ba8f36caea780ac8f0b3f7a0335cf8
2020-06-11 02:05:28 +00:00
TreeHugger Robot c39f708cb4 Merge "Fine tune blkio setting to improve boot time" into rvc-dev 2020-06-11 01:51:19 +00:00
android-build-team Robot ee029c3028 Make change and version bump to r_aml_300801200 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Iec096d5b01866095a23dcecd7fce8a581e0fedad
2020-06-10 07:15:19 +00:00
TreeHugger Robot b178f6da29 Merge "Increase size limit for pulled AStatsEvent" into rvc-dev am: d9f6d499f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11789976

Change-Id: Ia0e838eec7a3aec7ae9318c31abec4b42c0b2d2c
2020-06-10 05:00:57 +00:00
TreeHugger Robot d9f6d499f7 Merge "Increase size limit for pulled AStatsEvent" into rvc-dev 2020-06-10 04:52:37 +00:00
Muhammad Qureshi 9b9584b1a3 Increase size limit for pulled AStatsEvent
Increase AStatsEvent max byte size to 50 KB for pulled events.
All AStatsEvent instances are treated as pulled events unless
AStatsEvent_write() is called.

- Set the default max size to 50 KB
- The starting buffer size is still ~4 KB for pushed and pulled events.
- If a write would exceed the buffer bounds, double buffer size until
write fits or 50 KB limit is exceeded in which case the overflow bit is
set to true.
- If AStatsEvent_write() is called, max size is set to ~4 KB. And if
the current payload exceeds this limit, set overflow bit to true.

- Fix error mask checking in stats_event_test.
- Set ERROR_NO_ATOM_ID when atom id is missing.
- Make sure tests don't hit ERROR_TOO_MANY_FIELDS when testing buffer
overflow.
- Rename event->size to event->numBytesWritten

Fixes: 158214941
Test: libstatssocket_test
Change-Id: Ia26aeb775f7e4f2ffe87707bab6d0119e21da10e
2020-06-09 20:12:42 -07:00
TreeHugger Robot cc0d8647d0 Merge "adbd: remove ifdefs guarding root/secure." into rvc-dev am: ab7a967d1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11811383

Change-Id: Ie256a9516089c300adb9f159a9df4ad87501271e
2020-06-09 21:46:54 +00:00
TreeHugger Robot ab7a967d1c Merge "adbd: remove ifdefs guarding root/secure." into rvc-dev 2020-06-09 21:42:05 +00:00
Tom Cherry 86841a80fb Merge "Adding wait for a device file before mount" into rvc-dev am: fa94467894
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11810826

Change-Id: I16560a84d7960a6fd8b0fadeaeaf53cc81c122a6
2020-06-09 21:38:50 +00:00
Tom Cherry fa94467894 Merge "Adding wait for a device file before mount" into rvc-dev 2020-06-09 21:26:50 +00:00
TreeHugger Robot ab07cb3cdb Merge "Set block size in dm-bow" into rvc-dev am: 5ec1865b9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11791945

Change-Id: I25ee8bd79d3c7364df7126ccb5bec4487f323a25
2020-06-09 21:07:13 +00:00
TreeHugger Robot 5ec1865b9c Merge "Set block size in dm-bow" into rvc-dev 2020-06-09 20:57:23 +00:00
Josh Gao b6b70c23c9 adbd: remove ifdefs guarding root/secure.
The same adbd module prebuilt will get used for both user and userdebug
builds in the post-APEX world, so we can't guard functionality with
product variable ifdefs anymore.

The code that was previously compiled out runs before we drop root, so
the increased attack surface essentially consists of an attacker having
control over system properties, and that likely implies that we're
doomed already (either they have filesystem control, or they have code
execution in init).

Bug: http://b/158156979
Test: treehugger
Change-Id: Ia70d3140189e5212beb813ff719355e30ca5fa04
(cherry picked from commit d076857c4f)
2020-06-09 13:05:47 -07:00
Elliott Hughes 8ff796f939 Stop using varargs in libkeyutils. am: 8f4bb45a7b
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11808927

Change-Id: I01eed2bc6e1d52a4c06d0b5e4caa4e575e326757
2020-06-09 19:41:15 +00:00
Will Shiu f044f2d4d4 Adding wait for a device file before mount
Adding the function, fs_mgr_wait_for_file(), to ensure the
device file exists before to mount

Bug: 158064601
Merged-In: I74a68224073932773be18a79f9334d83ea5b6947
Change-Id: I74a68224073932773be18a79f9334d83ea5b6947
(cherry picked from commit 589b7dfd83)
2020-06-09 11:10:43 -07:00
Elliott Hughes 8f4bb45a7b Stop using varargs in libkeyutils.
It's error-prone, and our specific usage of it here upsets ubsan.

Bug: https://issuetracker.google.com/158428513
Test: treehugger
Change-Id: I3a6b68865e6b4c37ac005f5f24c3d6e1de7c5bac
Merged-In: I3a6b68865e6b4c37ac005f5f24c3d6e1de7c5bac
2020-06-09 09:32:35 -07:00
Paul Lawrence 39e4a7102b Set block size in dm-bow
Fix block-level checkpointing to work correctly when used in combination with
512 byte hardware sectors and metadata encryption with dm-default-key v2.

Bug: 153512828
Test: Parameter is passed to dm-bow based on first_api_level
Change-Id: Ic0a071221559271db20b06b2f17459b5b041e02d
Merged-In: Ic0a071221559271db20b06b2f17459b5b041e02d
2020-06-09 09:20:24 -07:00
android-build-team Robot 51dc7597bb Make change and version bump to r_aml_300801100 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I1ce79b75b9069fd0aa5a337aa7d86159936e3a99
2020-06-09 07:15:41 +00:00
Rick Yiu 11d167b575 Fine tune blkio setting to improve boot time
Bug: 133200996
Test: boot time test
Change-Id: I5262c28596adb7e849b202b8a163c190818f271a
Merged-In: I5262c28596adb7e849b202b8a163c190818f271a
2020-06-09 04:34:40 +00:00
Josh Gao 25f2e5e8a2 Merge "Move libadbd_auth, libadbd_fs to adbd_system_binaries." into rvc-dev am: b1df146aef
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11798192

Change-Id: Id98cb7dd8df78d30cf76760a7d82ac79fc2b81a6
2020-06-08 23:23:51 +00:00
Alistair Delva 63e8442744 Respect ro.boot.fstab_suffix in swapon_all am: afaa5fbccc
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11796125

Change-Id: I51c73252bf14589f249f8150aeede058936ddbb3
2020-06-08 23:23:42 +00:00
Alistair Delva ae45a52e4d Add documentation for umount_all am: 46f25dee36
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11796124

Change-Id: I80cc50d59d2b712bb116ef2ad451cf0097824336
2020-06-08 23:23:40 +00:00
Josh Gao b1df146aef Merge "Move libadbd_auth, libadbd_fs to adbd_system_binaries." into rvc-dev 2020-06-08 23:05:20 +00:00
Josh Gao 0217d52d01 Move libadbd_auth, libadbd_fs to adbd_system_binaries.
The required block inside the definition of "adbd" does nothing: we get
the libraries it contains via direct dependency when building from
source, and not at all when using a prebuilt. Move them to a phony
rule that's explicitly listed in PRODUCT_PACKAGES.

Bug: http://b/157709367
Test: treehugger
Change-Id: I97c0889558482cfbe18ae91b39b6889d3fee877c
(cherry picked from commit e572f2fc44)
2020-06-08 21:24:26 +00:00
Alistair Delva afaa5fbccc Respect ro.boot.fstab_suffix in swapon_all
While mount_all and umount_all were updated to use ro.boot.fstab_suffix,
I neglected to update swapon_all. Trivially copied from umount_all.

Bug: 142424832
Change-Id: Icd706fe7a1fe16c687cd2811b0a3158d7d2e224e
2020-06-08 11:36:05 -07:00
Alistair Delva 46f25dee36 Add documentation for umount_all
The mount_all and swapon_all commands are documented, but umount_all
is not. Add some documentation.

Bug: 142424832
Change-Id: I7e4dcb4d222b787350a79c9e312062cac9eeb4d8
2020-06-08 11:29:13 -07:00
android-build-team Robot 4b1e2ec8fb Make change and version bump to r_aml_300801000 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I4a8b369adf64c0ad9c7b8c1657c3ddd0d211c43e
2020-06-08 07:15:27 +00:00
android-build-team Robot 124e98a392 Make change and version bump to r_aml_300800800 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I597fd46b14de4a3c56e88a982aa3f7b63ae3ffb3
2020-06-07 07:16:04 +00:00
android-build-team Robot b92540d372 Make change and version bump to r_aml_300800500 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I7a1c00023f8f74601938400a19756b27214c578d
2020-06-05 16:29:33 +00:00
android-build-team Robot dfe888fd97 Make change and version bump to r_aml_300800400 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I116f19c2a51422319f63eaf558b1254977aecb5d
2020-06-05 07:30:08 +00:00
Woody Lin d90301caa5 libsparse: Limit block size to 64 MB am: 39bdf397fa
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11716812

Change-Id: I331435cce598b32c211f56a65b82f2741824618b
2020-06-04 23:04:55 +00:00