Commit graph

60989 commits

Author SHA1 Message Date
Alex Buynytskyy
999eda1302 Merge "Signature checks." am: 0aa0581404 am: 3fc21d4802
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1321890

Change-Id: Ifb105e95a0b495320e0ed69483d63b1ca3081721
2020-06-03 00:56:50 +00:00
Alex Buynytskyy
3fc21d4802 Merge "Signature checks." am: 0aa0581404
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1321890

Change-Id: Ia2249d3db0e7b7dd048b6ef09780bc156d1bcc6b
2020-06-03 00:44:25 +00:00
Alex Buynytskyy
0aa0581404 Merge "Signature checks." 2020-06-03 00:30:34 +00:00
Alex Buynytskyy
7405a92e35 Signature checks.
- signature size validation,
- no-signature files support (e.g. .dm).

Bug: 157077910 150803885
Fixes: 157077910
Test: atest adb_test adbd_test

Change-Id: I03a4f32a87568bd6f447f66c8aab666fb0b27199
2020-06-02 23:12:58 +00:00
Tom Cherry
ff3bd58b97 Merge "logd: move leading_dropped logic into FlushTo()" am: a8b8d108e5 am: a9b4222196
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1320576

Change-Id: I7ef591e802e260a1c61db34330845321092ac884
2020-06-02 22:01:36 +00:00
Treehugger Robot
f8edf1fc16 Merge "adb: don't use parameterized in test_adb.py." am: 648266ab1c am: 1d73552164
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1322179

Change-Id: Ic531714dd7526f0aa627c5d60e90fd3052911439
2020-06-02 22:01:22 +00:00
Tom Cherry
a9b4222196 Merge "logd: move leading_dropped logic into FlushTo()" am: a8b8d108e5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1320576

Change-Id: I8129ea7791ef4291e2a7d8ca8b14698a933fc8c7
2020-06-02 21:56:12 +00:00
Tom Cherry
a8b8d108e5 Merge "logd: move leading_dropped logic into FlushTo()" 2020-06-02 21:51:17 +00:00
Treehugger Robot
1d73552164 Merge "adb: don't use parameterized in test_adb.py." am: 648266ab1c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1322179

Change-Id: Icca5eb952bc158013efdb6851d8d6f7a1c794cba
2020-06-02 21:49:15 +00:00
Treehugger Robot
648266ab1c Merge "adb: don't use parameterized in test_adb.py." 2020-06-02 21:31:21 +00:00
Tom Cherry
11237f9e0d Merge "logd: format LogBufferElement and LogStatistics correctly" am: 4ab0bc414d am: 6e63019c63
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1322875

Change-Id: I3896bfb931619d385d983c94e79145e5fa96d66e
2020-06-02 20:38:08 +00:00
Tom Cherry
b3e163399a logd: move leading_dropped logic into FlushTo()
This logic isn't generic, so it should not be in the generic
LogReaderThread.

Moreover, it's currently broken in essentially every case except when
filtering by UID, because it runs as in the filter functions before
the actual filtering by pid/etc takes place.  For example, when
filtering by pid, it's possible to get leading chatty messages.  The
newly added test was failing previously but is fixed by this change.

It's fundamentally broken in the tail case.  Take this example:
1: Normal message
2: Chatty message
3: Normal message
4: Normal message

If you read that log buffer with a tail value of 3, there are three
possible outcomes:
1) Messages #2-4, however this would include a leading chatty message,
   which is not allowed.
2) Messages #3-4, however this is only 2, not 3 messages.
3) Messages #1-4, however this is 4, more than the 3 requested
   messages.

This code chooses 2) as the correct solution, in this case, we don't
need to account for leading chatty messages when counting the total
logs in the buffer.  A test is added for this case as well.

Test: new unit test
Change-Id: Id02eb81a8e77390aba4f85aac659c6cab498dbcd
2020-06-02 13:26:48 -07:00
Tom Cherry
6e63019c63 Merge "logd: format LogBufferElement and LogStatistics correctly" am: 4ab0bc414d
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1322875

Change-Id: I871b7dcbc38e911665a5df2565b2a2cb07c2a0e2
2020-06-02 20:23:30 +00:00
Josh Gao
3f2f3bacf9 adb: don't use parameterized in test_adb.py.
The test bots don't have this module installed.

Test: treehugger
Change-Id: I849a075b784eac296608e45bec7b2fce38f56ac4
2020-06-02 13:14:45 -07:00
Tom Cherry
4ab0bc414d Merge "logd: format LogBufferElement and LogStatistics correctly" 2020-06-02 20:07:52 +00:00
Tom Cherry
9787f9a054 logd: format LogBufferElement and LogStatistics correctly
Test: logging unit tests
Change-Id: If63be065e38f2a1c4cf2807ceaa9eea180b16c51
2020-06-02 11:38:44 -07:00
Tom Cherry
5bbbfd2801 Merge changes Id47b288d,I969565eb,Iba2e654e am: 365fdb7acb am: 76dac24797
Original change: undetermined

Change-Id: I9e9498a4436364e121bd7cf1fbf9917ce1aaf58a
2020-06-02 16:09:56 +00:00
Tom Cherry
76dac24797 Merge changes Id47b288d,I969565eb,Iba2e654e am: 365fdb7acb
Original change: undetermined

Change-Id: I5478564414c48ce0ab0c84ecd4a1e31eb3ec2eec
2020-06-02 15:51:51 +00:00
Tom Cherry
365fdb7acb Merge changes Id47b288d,I969565eb,Iba2e654e
* changes:
  logd: drop can_read_security_logs
  logd: create FlushToState class
  logd: fix bug in FlushTo when requesting exact sequence number
2020-06-02 15:41:03 +00:00
Tom Cherry
eb49b04e21 logd: drop can_read_security_logs
This has become useless after refactoring; we instead ensure that the
LOG_ID_SECURITY bit isn't set in log_mask, instead of having this
additional check.

Test: logging unit tests
Change-Id: Id47b288d056ebf2b5bd26be94006f17c24fafd31
2020-06-01 14:45:02 -07:00
Tom Cherry
855c7c87a3 logd: create FlushToState class
ChattyLogBuffer::FlushTo() needs an array of pid_t's to differentiate
between deduplication and spam removal chatty messages, but that won't
be useful to other log buffers, so it doesn't deserve its own entry in
the abstruct LogBuffer::FlushTo() function.

Other log buffers may need their own data stored for each reader, so
we create an interface that the reader itself owns and passes to the
log buffer.  It uses a unique_ptr, such that the when the reader is
destroyed, so will this state.

FlushToState will additionally contain the start point, that it will
increment itself and the log mask, which LogBuffers can use to
efficiently keep track of the next elements that will be read during a
call to FlushTo().

Side benefit: this allows ChattyLogBufferTests to correctly report
'identical' instead of 'expired' lines the deduplication tests.

Side benefit #2: This updates LogReaderThread::start() more
aggressively, which should result in readers being disconnected less
often, particularly readers who read only a certain UID.

Test: logging unit tests
Change-Id: I969565eb2996afb1431f20e7ccaaa906fcb8f6d1
2020-06-01 14:45:02 -07:00
Tom Cherry
90e9ce0c28 logd: fix bug in FlushTo when requesting exact sequence number
SimpleLogBuffer::FlushTo() attempts to find the iterator matching a
given sequence number, but the logic is wrong and will always skip one
element forward.  This change fixes this and adds a test for the
situation.

This likely contributed to some test instability in the past, but was
identified because subsequent changes that track the start value
closer exacerbated this issue.

Test: existing and new unit tests
Change-Id: Iba2e654e94234693dba20d4747a60bc79d195673
2020-06-01 14:44:56 -07:00
Tej Singh
906d66029f Merge "Retry pullfinish with empty payload if call fails" into rvc-dev am: 84db2e40e1
Change-Id: Id9739a2a1434c723b6c25b306eb98ede85454b83
2020-06-01 19:40:19 +00:00
Tej Singh
84db2e40e1 Merge "Retry pullfinish with empty payload if call fails" into rvc-dev 2020-06-01 19:14:09 +00:00
Yifan Hong
4293ab76ab Merge "libsnapshot: proto use correct index" into rvc-dev am: ee418ecb66
Change-Id: I317be09409cbd0be94dfa60f1a212ed6e5d20281
2020-05-31 21:58:46 +00:00
Yifan Hong
ee418ecb66 Merge "libsnapshot: proto use correct index" into rvc-dev 2020-05-31 21:47:14 +00:00
Alessio Balsini
4b1d97a696 [automerger skipped] Merge "libsnapshot: Export COW image size" into rvc-dev am: 3ec696d0ce -s ours
am skip reason: Change-Id I4faa0785f23884e26161e0d51268dd7a305d86bf with SHA-1 02e639d1f5 is in history

Change-Id: Ib0d9a64191561522f68183fad63c08b2c1c5370f
2020-05-31 12:28:24 +00:00
Alessio Balsini
3ec696d0ce Merge "libsnapshot: Export COW image size" into rvc-dev 2020-05-31 12:20:46 +00:00
Howard Ro
a0ef95ab60 Merge "Libstatspull: decrease default pull timeout to 2s" into rvc-dev am: 413668bcf3
Change-Id: I84a5571cb536f734805bffe9af9bc8e731c318b0
2020-05-30 10:17:46 +00:00
Howard Ro
413668bcf3 Merge "Libstatspull: decrease default pull timeout to 2s" into rvc-dev 2020-05-30 09:59:13 +00:00
Yifan Hong
8d996c4d3f libsnapshot: proto use correct index
Test: pass
Bug: 154016862
Change-Id: I845d2250ddb27bdbaee0d54663a2fdb45dbfbd11
2020-05-30 03:13:17 +01:00
Alessio Balsini
2898343409 libsnapshot: Export COW image size
Enable libsnapshot to export the size of the COW image, representing the
fraction of the COW device that is temporarily created in the /data
partition, computed just before initializing a merge operation.
Thise additional information can be used by other components (i.e.,
update engine) to enrich Virtual A/B metrics.

Bug: 154016862
Test: manual OTA
Signed-off-by: Alessio Balsini <balsini@google.com>
Signed-off-by: Yifan Hong <elsk@google.com>
Change-Id: I4faa0785f23884e26161e0d51268dd7a305d86bf
Merged-In: I4faa0785f23884e26161e0d51268dd7a305d86bf
(cherry picked from commit 2a1778d340)
2020-05-30 03:12:57 +01:00
Yifan Hong
8a4d3489c3 Merge changes I845d2250,I4faa0785 am: 51b127c71e am: 7a5b39709a
Change-Id: I444ee9e93aceedc276ab6e756bf698bba396ba6d
2020-05-30 01:33:15 +00:00
Alessio Balsini
e85a1ecf29 libsnapshot: Export COW image size am: 02e639d1f5 am: c757b578f7
Change-Id: I08df2866ecb5b04f049fa848dfa08e0dce0db12d
2020-05-30 01:33:12 +00:00
Yifan Hong
7a5b39709a Merge changes I845d2250,I4faa0785 am: 51b127c71e
Change-Id: Id4e378b449cd7939ff156199e189490b1de3ff56
2020-05-30 01:22:12 +00:00
Alessio Balsini
c757b578f7 libsnapshot: Export COW image size am: 02e639d1f5
Change-Id: Icb741f3a9454a4e54cbb31e444272b6042a1340c
2020-05-30 01:22:10 +00:00
Yifan Hong
51b127c71e Merge changes I845d2250,I4faa0785
* changes:
  libsnapshot: proto use correct index
  libsnapshot: Export COW image size
2020-05-30 01:06:56 +00:00
Tej Singh
00ffb6c77e Libstatspull: decrease default pull timeout to 2s
Decrease the default pull timeout to 2 seconds.

Test: atest LibStatsPullTests
Test: atest libstatspull_test
Bug: 154056912
Change-Id: I8f7660de64e8c74a8c7ce7d252369c0456895e3b
2020-05-29 23:37:21 +00:00
Yifan Hong
a30076404e libsnapshot: proto use correct index
Test: pass
Bug: 154016862
Change-Id: I845d2250ddb27bdbaee0d54663a2fdb45dbfbd11
2020-05-29 16:21:40 -07:00
Alessio Balsini
02e639d1f5 libsnapshot: Export COW image size
Enable libsnapshot to export the size of the COW image, representing the
fraction of the COW device that is temporarily created in the /data
partition, computed just before initializing a merge operation.
Thise additional information can be used by other components (i.e.,
update engine) to enrich Virtual A/B metrics.

Bug: 154016862
Test: manual OTA
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: I4faa0785f23884e26161e0d51268dd7a305d86bf
Merged-In: I4faa0785f23884e26161e0d51268dd7a305d86bf
2020-05-29 23:19:39 +00:00
David Anderson
c27a511515 libdm: Fallback to legacy ueventd logic if running on an older system. am: b2cc8cb2d7
Change-Id: I80baa6bbb71eaf129de60853475a00507ea2ada9
2020-05-29 22:24:54 +00:00
Tej Singh
c95f781901 Retry pullfinish with empty payload if call fails
If the first call for pullFinished fails, it is likely because the
transaction is too large. Currently, if this happens statsd will just
sleep until the timeout. With this change, the client will retry calling
pullFinish if the first attempt fails, but with an empty payload (and
with success = false) to cause the puller to fail fast, and so statsd
does not wait for the timeout.

Test: atest LibStatsPullTests
Bug: 157768117
Change-Id: I3af991fae47bb7c09bf8a6fc83f28556b836c6e4
2020-05-29 15:21:08 -07:00
David Anderson
de560a6e41 Merge "libdm: Fallback to legacy ueventd logic if running on an older system." am: b0b5d4f400 am: aa5ee42194
Change-Id: I26e29b6164175d499e6feab9a9b9882946346afa
2020-05-29 21:41:29 +00:00
David Anderson
31723a2836 Merge "fastboot: Allow fastboot to asynchronously differentiate between fastboot and fastbootd." am: e681cf01c8 am: be1327eb52
Change-Id: I935af340ac826a61e190a73d9357b0186e2ed806
2020-05-29 21:40:26 +00:00
David Anderson
aa5ee42194 Merge "libdm: Fallback to legacy ueventd logic if running on an older system." am: b0b5d4f400
Change-Id: I7aa899708869ab24d254cbebe33a73810e9ed0fa
2020-05-29 21:30:33 +00:00
David Anderson
be1327eb52 Merge "fastboot: Allow fastboot to asynchronously differentiate between fastboot and fastbootd." am: e681cf01c8
Change-Id: Id921eb30a4ddbd0975d230f064321afa9a0fdad8
2020-05-29 21:26:59 +00:00
David Anderson
b2cc8cb2d7 libdm: Fallback to legacy ueventd logic if running on an older system.
When delivering single-stage, non-AB OTAs, the updater binary is built
on a newer OS than recovery is compiled with. libdm relies on newer ueventd
behavior which therefore breaks this model. As a workaround, we allow
libdm to fallback to the old ueventd logic if the following conditions
hold true: (1) we're in recovery, (2) the device is not an AB device,
and (3) the release is <= 10.

Since the old ueventd behavior can lead to races in libdm, this fallback
should stay as narrow as possible.

Bug: 156536673
Bug: 155202260
Test: manual test
Change-Id: I7f9da49e4ba8dfe165e0923d9918827d51d090cd
2020-05-29 18:13:48 +00:00
Martijn Coenen
4ff6531bc5 Merge changes from topic "fusectl" into rvc-dev am: 6030f2f016
Change-Id: I4888400ae48f4061e938832f49c8d1e453798244
2020-05-29 14:54:54 +00:00
Martijn Coenen
6030f2f016 Merge changes from topic "fusectl" into rvc-dev
* changes:
  Abort FUSE filesystems during shutdown.
  Abort FUSE filesystem when Zygote restarts.
  Mount fusectl filesystem.
2020-05-29 14:41:20 +00:00
David Anderson
b0b5d4f400 Merge "libdm: Fallback to legacy ueventd logic if running on an older system." 2020-05-29 05:06:22 +00:00