Commit Graph

58542 Commits

Author SHA1 Message Date
Yo Chiang 8cf6a0b69e Merge "Move SingletonTest back to libutils_test" am: 9a57044ab3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360220

Change-Id: Ic9c06cf69623150c041ce5e544a8eb6321f39623
2020-07-13 03:59:41 +00:00
Yo Chiang 9a57044ab3 Merge "Move SingletonTest back to libutils_test" 2020-07-13 03:49:17 +00:00
Matthew Maurer 85128d42c9 Merge "trusty: rpmb_dev: Prevent desync between rpmb_dev and storageproxyd" am: 30b0838b70
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360681

Change-Id: I85b0dfc9092d44023d5c5d5dc5bbc1a867f765e4
2020-07-10 22:47:58 +00:00
Matthew Maurer 30b0838b70 Merge "trusty: rpmb_dev: Prevent desync between rpmb_dev and storageproxyd" 2020-07-10 22:27:24 +00:00
Matthew Maurer 8f62566566 trusty: rpmb_dev: Prevent desync between rpmb_dev and storageproxyd
The mock RPMB can get out of sync with TD storage blocks in the event of
panic or crash. Making this O_SYNC will prevent this from happening.

Bug: 160723681
Test: None
Change-Id: Ia16dfc88ceae56e4e9724a42ac0db492c0e707a4
2020-07-10 22:09:01 +00:00
Treehugger Robot e526b545cd Merge "init README: document AIDL service interface" am: 4d3c284605
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360957

Change-Id: I2900e7a9ea5f19c185112a4d6394b0087fda048d
2020-07-10 19:41:00 +00:00
Tom Cherry cb8ddce387 Merge "liblog: remove faulty logic in __android_logger_valid_buffer_size" am: 089455f163
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1360177

Change-Id: Iea70205318f7dda34db469fa4d1563a85128c81e
2020-07-10 19:40:53 +00:00
Treehugger Robot 4d3c284605 Merge "init README: document AIDL service interface" 2020-07-10 19:30:52 +00:00
Tom Cherry 089455f163 Merge "liblog: remove faulty logic in __android_logger_valid_buffer_size" 2020-07-10 19:26:38 +00:00
Steven Moreland fa2457e1cd init README: document AIDL service interface
There is documentation for how AIDL works with ctl commands or
interface_start commands, however it seems we were missing documentation
on declaration of interfaces.

Bug: N/A
Test: N/A
Change-Id: I0e5d2350b6b847a870eafbc69828e75f1f6ca4f0
2020-07-10 17:53:18 +00:00
Yo Chiang 5b028bab2a Move SingletonTest back to libutils_test
Use the new "data_libs:" to specify test library dependency. This is
like "data:" and it treats compiled libraries as test data files.
The result is libutils_test_singleton{1,2} is picked up by libutils_test
and installed next to the test binary.

Mark the test libs libutils_test_singleton{1,2} as uninstallable. This
prevents installing libutils_test_singleton{1,2} directly and only
permits installing via "data_libs:".

```
$ m libutils_test
testcases
└── libutils_test
    ├── arm
    │   ├── libutils_test
    │   ├── libutils_test_singleton1.so
    │   └── libutils_test_singleton2.so
    ├── arm64
    │   ├── libutils_test
    │   ├── libutils_test_singleton1.so
    │   └── libutils_test_singleton2.so
    └── libutils_test.config
```

Bug: 124838889
Test: atest libutils_test
Change-Id: I432135e128fc9eedb1b8c18a331957e271d8b0f0
2020-07-10 19:34:53 +08:00
Tom Cherry 0315b29497 liblog: remove faulty logic in __android_logger_valid_buffer_size
In testing, I saw that the 'main' and 'events' log buffers were set to
incorrect sizes when they were intended to be >= 4MB.  The bug is
tracked down to an invalid line in
__android_logger_valid_buffer_size():

  /* maximum memory impact a somewhat arbitrary ~3% */
  pages = (pages + 31) / 32;

There are two issues with this line:
1) That is not the right calculation for 3%.
2) `pages` is a static variable, so it repeatedly is decremented until
   reaching 1.

The consequence is that this function gives invalid results for the
first few calls, then returns true as long as the input is between
LOG_BUFFER_MIN_SIZE and LOG_BUFFER_MAX_SIZE.  That check is enough, so
the rest of this logic is removed.

Test: buffers are set to the right sizes.
Change-Id: I4d19b1d0fdbd83843d2d61a484ac083d571ef37b
2020-07-09 20:39:17 -07:00
Tom Cherry 9c590e4c97 Merge "init: skip RejectsCriticalAndOneshotService for devices launched before R" am: c8e4154d89
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1359383

Change-Id: Id1ce1ce19e9df18c77fee7bd5e0f01ece54218fe
2020-07-09 19:48:25 +00:00
Tom Cherry c8e4154d89 Merge "init: skip RejectsCriticalAndOneshotService for devices launched before R" 2020-07-09 19:35:34 +00:00
Tom Cherry 0e40ba3183 init: skip RejectsCriticalAndOneshotService for devices launched before R
This restriction is only added for devices launching with R or later.

Bug: 160663765
Test: this test runs when appropriate
Change-Id: I2353bfa7f598bd19ba57498cc5bbad7a3ed34707
2020-07-09 08:49:29 -07:00
Treehugger Robot dad59e192d Merge "Add a libipchecksum that contains the C IP checksum code." am: 69b513ce09
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1359262

Change-Id: Ic463de260325ad19bd7889282f0a50b87013f459
2020-07-09 09:10:00 +00:00
Treehugger Robot 69b513ce09 Merge "Add a libipchecksum that contains the C IP checksum code." 2020-07-09 08:55:16 +00:00
Lorenzo Colitti 3b56a0226b Add a libipchecksum that contains the C IP checksum code.
This is useful for test code that wants to statically link the IP
checksum code. This is not currently possible because libnetutils
is vendor_available and making it available for static linking is
discouraged.

Test: m libnetutils libipchecksum
Change-Id: Ic7f1864902581b8a5e3626860565b78c168bdb7f
2020-07-09 16:35:47 +09:00
Tianjie Xu 14bc7fb7e4 Merge "Add function to compare the partitions' extents in metadata" am: d7b4fe95c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1352612

Change-Id: I7faf667612073b69a6afc1ab0b7fa8a1304b1e0a
2020-07-09 03:03:09 +00:00
Tianjie Xu d7b4fe95c7 Merge "Add function to compare the partitions' extents in metadata" 2020-07-09 02:46:47 +00:00
Treehugger Robot e7ab54aba3 Merge "Added fuzzer for Unwinder" am: e28cc8cf48
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1318953

Change-Id: If64ec3c8d305487782c8651173c47d8b7c26616c
2020-07-09 01:35:23 +00:00
Treehugger Robot e28cc8cf48 Merge "Added fuzzer for Unwinder" 2020-07-09 01:22:01 +00:00
Treehugger Robot 8f713c56bb Merge changes I51628abe,I412d62b7 am: 9e84b3166f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1358184

Change-Id: Ia7b7e643c2326fb49ad0966dd1b69339650b6801
2020-07-08 21:38:13 +00:00
Yifan Hong dee7426a9b Try locking after mounting metadata am: fc1e1aeef9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1358183

Change-Id: I4172d1230feb6038943c2fcc0aa409b0bd837f71
2020-07-08 21:38:12 +00:00
Treehugger Robot 9e84b3166f Merge changes I51628abe,I412d62b7
* changes:
  Wrap flock with TEMP_FAILURE_RETRY.
  Try locking after mounting metadata
2020-07-08 21:23:01 +00:00
Treehugger Robot 784ab6ed10 Merge "Add libdm and dmctl support for dm-user targets" am: 3042f0ff9f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1346622

Change-Id: I2cc257816812006d3a018d2896eb067e897cfc63
2020-07-08 21:13:46 +00:00
Treehugger Robot 3042f0ff9f Merge "Add libdm and dmctl support for dm-user targets" 2020-07-08 20:59:41 +00:00
Yifan Hong fc1e1aeef9 Try locking after mounting metadata
In rescue mode, if /metadata is mounted but /metadata/ota does
not exist, immeidately unmount /metadata and fallback to the code
path when /metadata is not mounted; that is, old partitions are
overwritten.

Test: in recovery, select wipe then immediately sideload
Bug: 160457903
Change-Id: I412d62b7005c81a7126106edc471622e6a7ef813
Merged-In: I412d62b7005c81a7126106edc471622e6a7ef813
2020-07-08 13:46:23 -07:00
Yifan Hong c96ab99136 Wrap flock with TEMP_FAILURE_RETRY.
flock may return EINTR. There are code using LockShared() to test
existance of the directory. Don't fail spuriously.

Test: pass
Bug: 160457903
Change-Id: I51628abe05599422eb3f344781d8f3acd653c822
Merged-In: I51628abe05599422eb3f344781d8f3acd653c822
2020-07-08 13:46:23 -07:00
Steven Moreland 313e7de136 Merge "libutils: integer sanitization" am: 1652ac276a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1356015

Change-Id: Iab10ec2fa6ab502f527d7116c9e17a1547026f5a
2020-07-08 17:00:33 +00:00
Steven Moreland 1652ac276a Merge "libutils: integer sanitization" 2020-07-08 16:45:14 +00:00
Wei Wang 7531866047 Merge "Boost init priority before main loop" am: 4203129353
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1355811

Change-Id: Ia522df2faed978cb321b40f006ce8e7c2d9d8758
2020-07-08 05:06:19 +00:00
Wei Wang 4203129353 Merge "Boost init priority before main loop" 2020-07-08 04:53:04 +00:00
Treehugger Robot e47bb665c0 Merge "Move build.prop to ./etc subdir for some partitions" am: 90fe62e76e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1351307

Change-Id: I47bd3924f9f2bf39c5c63ab9e084f93fe69b78d0
2020-07-08 00:23:06 +00:00
Treehugger Robot 90fe62e76e Merge "Move build.prop to ./etc subdir for some partitions" 2020-07-08 00:03:30 +00:00
Wei Wang 30bbf7d0ad Boost init priority before main loop
Now we have more things e.g. loading kernel modules, initialize
selinux. And before all these, system cannot make further progress. It
should be beneficial to boost this critical peroid in init.

Benchmark on a Pixel device shows this saves 100+ms on early boot

ToT release + This CL (P15538587)
D/BaseBootTest: init_stage_second_START_TIME_avg : 1563.4
D/BaseBootTest: ueventd_Coldboot_avg : 219.0
D/BaseBootTest: action_init_/system/etc/init/hw/init.rc:114_START_TIME_avg : 2103.7

ToT release (6654154)
D/BaseBootTest: init_stage_second_START_TIME_avg : 1639.0
D/BaseBootTest: ueventd_Coldboot_avg : 238.2
D/BaseBootTest: action_init_/system/etc/init/hw/init.rc:114_START_TIME_avg : 2226.0

Bug: 143857500
Bug: 147997403
Bug: 160271169
Bug: 160696502
Test: Boottime
Signed-off-by: Wei Wang <wvw@google.com>
Change-Id: I21c9e051f4ae3e953d991c031f151b2779702548
2020-07-07 15:50:58 -07:00
Steven Moreland 9c832028c1 libutils: integer sanitization
For sanity.

Fixes: 160342252
Test: manually introduce overflow for "ubsan: mul-overflow"
Change-Id: I292039eaef24582f05dd9f0fef011f0ece8364ed
2020-07-07 22:37:07 +00:00
Jiyong Park 8178c5f0c9 Move build.prop to ./etc subdir for some partitions
build.prop files under system_ext, product, and odm partitions are moved
to the ./etc subdirectory. This is to be in-line with the established
practice of having all configuration files under ./etc subdir.
build.prop doesn't need to be an exception.

However, system/build.prop and vendor/build.prop were not moved because
there are a lot of apps and tools that depend on the path.

Bug: 158735147
Test: device has build.prop under ./etc and is bootable
Change-Id: I26300574c23c78cc4e5bc20f98fc9702838465e1
2020-07-08 02:18:16 +09:00
Tom Cherry 8edc5e449c Merge "Add AMBA bus support to platform devices" am: b88a97b41e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1353606

Change-Id: Ica4bcd2446da9e29a43c314d25185d1c856abcce
2020-07-07 15:32:26 +00:00
Tom Cherry b88a97b41e Merge "Add AMBA bus support to platform devices" 2020-07-07 15:14:14 +00:00
Tianjie 07c951fcf3 Add function to compare the partitions' extents in metadata
For partial updates, the metadata for untouched dynamic partitions
are just copied over to the target slot. So, verifying the extents
of these partitions in the target metadata should be sufficient for
correctness. And we don't need to read & hash the bytes on these
partitions.

Bug: 151088567
Test: unit tests pass
Change-Id: I95836ee6f76d884c7a1f5537154ac7230563493a
2020-07-06 17:40:01 -07:00
Treehugger Robot 95c78ad7b9 Merge "liblp: Force 10.0 metadata on downgrade to Q." am: 3d882d0536
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1355806

Change-Id: I2d0e0eb40165fda369f5ebbf6dc9125449353e8b
2020-07-06 22:41:22 +00:00
Treehugger Robot 3d882d0536 Merge "liblp: Force 10.0 metadata on downgrade to Q." 2020-07-06 22:19:55 +00:00
Jooyung Han f7cb833300 Merge "init: generate apex-info-list.xml" am: a657c799bf
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1354547

Change-Id: I4beef3524237f39f8ef7da8ee82ab816e1bde2b0
2020-07-06 21:46:58 +00:00
Jooyung Han a657c799bf Merge "init: generate apex-info-list.xml" 2020-07-06 21:32:25 +00:00
Yifan Hong a819a3cad2 liblp: Force 10.0 metadata on downgrade to Q.
Q liblp only supports 10.0 super partition metadata, so
forcefully downgrade the current metadata version too.

On retrofit Virtual A/B devices, the metadata version is
at most 10.1, because the new VIRTUAL_AB flag is not set
on retrofit devices.

In version 10.1, two per-partition flags: UPDATED and DISABLED
are introduced.
- The updated flag is set when the device undergoes a Virtual A/B
update before. Clear it.
- The disabled flag should only be set on metadata files used by
libfiemap ImageManager. It shouldn't be used on super partition metadata.

Hence, this CL should only clear UPDATED flag.

Test: R->R->Q OTA
Bug: 159590481
Change-Id: I8b548c8ce36a75197e7172a77f9207fd44fe4670
(cherry picked from commit ba5dfd76de)
Merged-In: I8b548c8ce36a75197e7172a77f9207fd44fe4670
2020-07-06 13:36:20 -07:00
Josh Gao d6fcfc8099 Merge "[adb] Fix crash in mdns service removal." am: 7229923bcd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1352926

Change-Id: Ic92ae62b4ddfc47b7bb85227b841558e8330bd67
2020-07-06 20:24:44 +00:00
Josh Gao 7229923bcd Merge "[adb] Fix crash in mdns service removal." 2020-07-06 20:14:27 +00:00
Jooyung Han 1d951b7700 init: generate apex-info-list.xml
If a device doesn't support unflattened APEXes, init activates flattened
APEXes instead of apexd.

Because apexd dumps apex-info-list.xml after it activates all APEXes,
init should do the same thing.

Bug: 159585065
Test: lunch aosp_cf_x86_phone_noapex & m & boot
      adb more /apex/apex-info-list.xml
      adb shell ls -lZ /apex/apex-info-list.xml
       -> -rw-rw-rw- 1 root root u:object_r:apex_info_file:s0 ..
Change-Id: I74a4d0ee363761564225097c5949e5ce335ac6dc
2020-07-05 00:12:04 +00:00
Jim Kaye a283bf1bdb Merge "Add Silent Mode boot controls" am: 08097d4ba4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1353985

Change-Id: I924c026070bdf2a5458af6594fba1dd36aad5da3
2020-07-03 18:24:20 +00:00