Commit graph

84582 commits

Author SHA1 Message Date
Yi-Yo Chiang
c0281978b0 Merge "fs_mgr: Don't run clean_scratch_files on non-dynamic devices" into main 2023-10-16 10:24:55 +00:00
Kelvin Zhang
9c949326bd Merge "Make partition metadata write atomic" into main 2023-10-14 00:01:41 +00:00
David Anderson
5233181ded Merge "Remove unused variable in snapuserd_core." into main 2023-10-13 23:03:26 +00:00
Kelvin Zhang
78d5352289 Make partition metadata write atomic
We have seen multiple OTA failures with invalid geometry magic
signature. Make partition metadata write atomic by writing to a tmpfile
first and then do a rename.

Test: th
Bug: 303770065
Bug: 298149189
Change-Id: Id1d565de73439b95b665144c2f02fc97273d341c
2023-10-13 15:46:28 -07:00
David Anderson
7e407514dd Remove unused variable in snapuserd_core.
Bug: N/A
Test: builds
Change-Id: I8fc3bd2dd8eb3cfa3c6bfe513f054a4d6a674de1
2023-10-13 21:34:12 +00:00
Bradley Furman
c6941de738 Merge "Update the fastboot command size from 64 to 4096 to cover the changes from https://android-review.git.corp.google.com/c/platform/system/core/+/2214970" into main 2023-10-13 18:28:17 +00:00
Dennis Shen
f307ee0767 Merge "apply staged property value when loading persistent props" into main 2023-10-13 18:22:56 +00:00
Dennis Shen
678d268848 apply staged property value when loading persistent props
Bug: b/300111812
Change-Id: I81b6bd984aad8f7ddec93ce74f4543e4f71be508
Merged-In: I81b6bd984aad8f7ddec93ce74f4543e4f71be508
2023-10-13 13:18:50 +00:00
Kalesh Singh
d469fdcd93 Merge "trusty: Remove explicit page-alignment of mmap and dmabuf allocations" into main 2023-10-12 22:19:26 +00:00
Treehugger Robot
58e7eda0b0 Merge "libtrusty: Remove PAGE_SIZE usage" into main 2023-10-12 21:32:33 +00:00
Treehugger Robot
8eda323bc2 Merge "trusty: tipc_fuzzer: Remove use of PAGE_SIZE" into main 2023-10-12 21:11:25 +00:00
Treehugger Robot
99414ad00b Merge "keymaster: Remove usage of PAGE_SIZE" into main 2023-10-12 20:58:34 +00:00
Kalesh Singh
623d140cc0 trusty: Remove explicit page-alignment of mmap and dmabuf allocations
bionic hard codes the PAGE_SIZE macro as 4096. This is going away as
Android begins to support larger page sizes.

trusty uses PAGE_SIZE to round up the allocation size of the DMA
buffers and mmap sizes. This is not explicitly needed since the kernel
will always give you a page-aligned and page-sized multiple allocation
when allocating a dmabuf or mmap-ing.

Remove this PAGE_SIZE usage from TrustyApp, app_fuzzer, coverage,
line-coverage, modulewrapper.

Bug: 294914413
Test: Boot test on 16k device
Change-Id: Iad922e0a152cb80db2e59e696d7556602fd17d67
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 13:50:31 -07:00
Kalesh Singh
efeb096c40 libtrusty: Remove PAGE_SIZE usage
bionic provides PAGE_SIZE macro which happens to also match the
4096 chunk size in the tips_test.

PAGE_SIZE is being removed as no other libc provides this and
Android is moving towards being page-size-agnostic.

Use 4096 chunk size for tipc-tests; fix incorrect size in
munmap cleanup; and add failure log for send-fd test.

Test: tipc-test -t "send-fd"
Bug: 294914413
Change-Id: I7e5ec6480fff6bc1b4e8eed57eadf081cf82a72f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 13:35:29 -07:00
Kalesh Singh
bbc4bc54f2 keymaster: Remove usage of PAGE_SIZE
bionic provides PAGE_SIZE macro which happens to also match the
size keymaster send buffer (4096) and half the size of the recv
buffer.

PAGE_SIZE is being removed as no other libc provides this and
Android is moving towards being page-size-agnostic.

Use a 4096 constant instead.

Test: Boot 16k device
Bug: 294914413
Change-Id:  I2dc10b48811e24d25ba08cfe4ffb514e94d42a8f
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 20:03:08 +00:00
Kalesh Singh
5a2b8794fc trusty: tipc_fuzzer: Remove use of PAGE_SIZE
tipc_fuzzer writes random data of length 'size' and then
attempts to read back data up to 'TIPC_MAX_MSG_SIZE' in length.

Since 'size' is unrestricted we can always write more than the
subsequent read; and in effect the fuzzer only checks that we
can read something.

Remove the read buffer's dependency on PAGE_SIZE.

Bug: 294914413
Test: mma
Change-Id: I909b49fda4e6ebf49f69b3c09ac29ff8629215ef
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2023-10-12 20:02:34 +00:00
Yi-Yo Chiang
c519d1dde2 Merge "Revert "init_first_stage: Disable ThinLTO"" into main 2023-10-12 10:33:54 +00:00
Treehugger Robot
f7d982ec7f Merge "Skip android14-tests-dev" into main 2023-10-12 06:06:07 +00:00
Steven Moreland
cd9556cb96 Merge "libutils: use log/log.h internally" into main 2023-10-11 22:02:18 +00:00
Kelvin Zhang
d6fe3032a9 Merge "Revert "Shove type into source_info"" into main 2023-10-11 20:50:02 +00:00
Kelvin Zhang
b6153adde1 Revert "Shove type into source_info"
This reverts commit e90a39aee2.

Reason for revert: 304602386

Change-Id: Ib9d31bdadc7511e67f4c7e5731d18e7bf0162bfc
2023-10-11 19:44:38 +00:00
Nolen Johnson
cb33fb4008 fs_mgr: Don't run clean_scratch_files on non-dynamic devices
* This results in a metric ton of denials on some devices and
  eats up valuable resources on boot, plus there's 0 need for it,
  so kill it.

Change-Id: Ic52d5b3f06724430e9505345024cf0041b37ca49
2023-10-11 13:58:40 -04:00
Edward Liaw
da3caeab43 Merge "liblp_test: Add to kernel-presubmit" into main 2023-10-11 16:53:26 +00:00
Edward Liaw
f5736cb42a Merge "libdm_test: Add to kernel-presubmit" into main 2023-10-11 16:53:10 +00:00
Yi-Yo Chiang
1a3dd7eb4b Revert "init_first_stage: Disable ThinLTO"
This reverts commit 4d6fa8ccaf.

Reason for revert: b/295944813 is fixed

Bug: 304290959
Change-Id: I2d6f5216800d6ee26b25623898836dc216c8be18
Test: adb-remount-test.sh
2023-10-11 02:06:26 +00:00
Harry Pan
06949876be Merge "Add new fastbootd battery-soc variable" into main 2023-10-11 00:28:28 +00:00
Xin Li
8f3b94818a Skip android14-tests-dev
Bug: 263910020
Merged-In: Iedb7c32a594c3b1fca2904f3441029aaed7edf2a
Change-Id: Ied477b08d7d23de298ace72ae7ee69dda7c0671b
2023-10-10 16:18:22 -07:00
Edward Liaw
eafffc0c9c liblp_test: Add to kernel-presubmit
Bug: 284307085
Test: atest :kernel-presubmit
Change-Id: I2a138cf55a2af07b5c231f163196266f8b3dd524
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-10-10 23:13:30 +00:00
Edward Liaw
942a31e7be libdm_test: Add to kernel-presubmit
Bug: 284307085
Test: atest :kernel-presubmit
Change-Id: I13ae25f17c943825bdf5ee67c00b7d297cf6e319
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-10-10 23:05:09 +00:00
Daniel Zheng
dd3d34ffa7 Merge changes Ibe310d58,If88dceda into main
* changes:
  Move Cow Header child writer
  Add v3 Cow Header
2023-10-10 22:50:11 +00:00
Treehugger Robot
c2671853ae Merge "rpc_binder: Change trusty_tipc_fuzzer to support multiple connections and messages" into main 2023-10-10 22:13:42 +00:00
Daniel Zheng
bb45742ba1 Move Cow Header child writer
v2 writer and v3 writer will write different versions of the header.
It's better to have each writer hold it's own header.

Test: th
Change-Id: Ibe310d58b830950ad556aabcd0c1009483fc8d86
2023-10-10 15:06:26 -07:00
Daniel Zheng
ed1a7d5faf Add v3 Cow Header
Adding Version 3 of CowHeader. This will inherit from original
CowHeader and add a compression field. We are no longer supporting
different compressions per operation so having this one field is enough.

Test: cow_api_test
Change-Id: If88dceda139807cc5e647b706ddeb2b3e83c024f
2023-10-10 15:06:26 -07:00
Daniel Zheng
b3cd361bfd Merge "Rename BLOCK_SZ to block_size" into main 2023-10-10 21:56:16 +00:00
Daniel Zheng
f5f0a10541 Merge "Move ReadCowHeader to CowReader" into main 2023-10-10 21:56:11 +00:00
Daniel Zheng
a3646037c2 Merge "Shove type into source_info" into main 2023-10-10 21:11:33 +00:00
Daniel Zheng
73b3428e1c Rename BLOCK_SZ to block_size
BLOCK_SZ name to block_size as we should reserve all caps for compile
time constants

Test: th
Change-Id: I542632662e81b272ffec50d6b50c290d701b08e3
2023-10-10 12:55:28 -07:00
Daniel Zheng
e90a39aee2 Shove type into source_info
We can shove type into source info to save 8 bits in per cow operation.
We only need 4 bits inside of source_info to enumerate all the types of
Cow Operation:

static constexpr uint8_t kCowCopyOp = 1;
static constexpr uint8_t kCowReplaceOp = 2;
static constexpr uint8_t kCowZeroOp = 3;
static constexpr uint8_t kCowLabelOp = 4;
static constexpr uint8_t kCowClusterOp = 5;
static constexpr uint8_t kCowXorOp = 6;
static constexpr uint8_t kCowSequenceOp = 7;
static constexpr uint8_t kCowFooterOp = -1;

Test: critical ota paths on pixel
Change-Id: I22049db0b39a55bd8f863339f3751d3146d5c1e9
2023-10-10 12:55:27 -07:00
Daniel Zheng
76b1e83fad Move ReadCowHeader to CowReader
Moving this function to cow reader first we have to read the version of
cow from the header before deciding which parser to use. This is a more
logical place for this code to be in

Test: th
Change-Id: Ie5ba53439b4fc3c4c409426b818a2d53c0cbc3e5
2023-10-10 12:55:27 -07:00
Daniel Zheng
a065e8739e Merge "Update API usage for source" into main 2023-10-10 19:29:10 +00:00
Daniel Zheng
2d5ec079be Merge "Move Sync to base class" into main 2023-10-10 03:17:38 +00:00
Daniel Zheng
c197df70d8 Update API usage for source
replacing any instance of op->source_info with GetCowSourceinfoData as
that's what we're really looking for. This function will return the 48
bits associated with the source and not the extra bits that will store
type + other information. We should never be making a reference to
op->source_info directly as that has no real meaning, we should be
masking for the data that we really need

Test: cow_api_test
Change-Id: I259c790efdd13c61a4599e9edfc75cf0ba000c61
2023-10-09 20:15:34 -07:00
Daniel Zheng
f9f833066d Move Sync to base class
This function will be called in header write for both v3 and v2 writer.
Seems okay to move to base class as theres no unique functionality to
the v2 writer.

Test: cow_api_test

Change-Id: I70c1b08ce67127c9dcbd0f54b574d2cd5ad1d0b5
2023-10-09 20:15:34 -07:00
Daniel Zheng
f7f3b62f24 Merge "Removing compression bit from v3 op" into main 2023-10-10 03:09:58 +00:00
Daniel Zheng
3062a64f06 Merge "Add v3 writer" into main 2023-10-10 02:25:38 +00:00
Treehugger Robot
1258dabac7 Merge "init: Remove arbitrary delay in async persist writes." into main 2023-10-10 00:32:04 +00:00
Daniel Zheng
ce57c58e6b Removing compression bit from v3 op
We don't need the compression bit in v3 op since all operations will
have the same compression per COW Device and it will be stored within the COW header.
We can check to see if an operation contains compressioned data by
checking data_length and see if it's less than BLOCK_SZ

Test: 4 critical OTA paths
Change-Id: I3f86756d83bf54bf6efd15d9cb7ac064eefdd949
2023-10-09 13:31:20 -07:00
Daniel Zheng
04e4c2a6c2 Add v3 writer
Adding v3 writer that works off of Cow Operation v3. Adding test file
that will test this new writer. Adding in stub implementations to v3 writer. None of these functions
have to work yet, we just need the implementations here to compile.

Test: m libsnapshot
Change-Id: If86437d5ceb2c33520d4ca26dea5193984f86546
2023-10-09 13:31:19 -07:00
Yurii Shutkin
a7dd77670e Merge "acvp: handle flush commond in modulewrapper as stated in BoringSSL." into main 2023-10-09 15:36:47 +00:00
Yurii Shutkin
f75464d65e acvp: handle flush commond in modulewrapper as stated in BoringSSL.
Change-Id: Ife655f0764851cf2d9677abd507daec3f531031e
Bug: 287626912
Test: ACVP test
2023-10-09 15:37:29 +02:00