Commit graph

80376 commits

Author SHA1 Message Date
Akilesh Kailash
1324002fbf Merge "libsnapshot: Wait for daemon to terminate after snapshot unamp" 2023-02-10 23:49:33 +00:00
Bart Van Assche
b0947e008a libprocessgroup: Proceed if activation of an optional controller fails
Not all Android kernels support all the cgroup controllers mentioned in
task_profiles.json and/or cgroups.json. Support such kernels by ignoring
certain cgroup activation failures.

Bug: 213617178
Change-Id: I90c0bd959f8a6484c4f2fbc895845e073527271e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-10 15:02:44 -08:00
Akilesh Kailash
d2063ad7dd libsnapshot: Wait for daemon to terminate after snapshot unamp
During verification, update-engine will invoke
SnapshotMap() and Unmap() for every partition verification.

Post Unmap(), update-engine immediately invokes Map()
for next partition. This is a narrow window wherein, daemon
from previous unmap() is still present and init hasn't
terminated it. Thus, when next MapSnapshot() is invoked,
Connect() fails as init may end up terminating the service.

Wait for the daemon to fully terminate and exit
when Detach() is invoked.

Bug: 258514587
Test: OTA on Pixel, Map/Unmap in a loop
Change-Id: I36b7ce183dfa4c89a873118876d195480e28d48c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-02-10 14:31:52 -08:00
Bart Van Assche
1ec6ec4f57 libprocessgroup: Rework SetupCgroup()
Improve the readability of this function by splitting it.

This CL includes the following behavior changes:
- If changing the directory owner and/or mode fails for /sys/fs/cgroup,
  this is considered as a fatal error instead of something that should
  only fail if "Optional" has not been set.
- If mounting the v2 cgroup controller fails, this is considered as an
  error.
- Activating/mounting a cgroup controller only fails if the controller
  has not been marked as optional.

Bug: 213617178
Change-Id: If6908dfdbcb2e1c9637ab4ac8a7625f0a17dc9e0
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-10 14:18:38 -08:00
Vova Sharaienko
6f9a9092b7 Merge "[TeX] Introduced Telemetry Express Histogram metric Native API" 2023-02-10 20:31:43 +00:00
Dmitrii Merkurev
4dd1ac9282 Merge "fastboot: Introduce network-connected devices storage" 2023-02-10 20:27:15 +00:00
Treehugger Robot
9ed4eb61a6 Merge "BatteryMonitor: report battery health from health status" 2023-02-10 09:55:21 +00:00
Jack Wu
b57f68aedd BatteryMonitor: report battery health from health status
Bug: 251425963
Test: m
Change-Id: I0a34262c8146032120273ab9be4ef4d3b285d115
Signed-off-by: Jack Wu <wjack@google.com>
2023-02-10 07:40:20 +00:00
Sandeep Dhavale
ee065fe080 Merge "Fastboot: Use AServiceManager_waitForService instead of AServiceManager_getService" 2023-02-10 04:12:06 +00:00
Treehugger Robot
120902971b Merge "Only run GentleKill test as root" 2023-02-10 03:22:00 +00:00
Bart Van Assche
d9098252c6 Merge "libprocessgroup: Introduce a local variable in CgroupMap::ActivateControllers()" 2023-02-09 21:38:05 +00:00
David Anderson
d45181f1c2 Merge "fastboot: Add fastboot_test to TEST_MAPPING." 2023-02-09 21:33:26 +00:00
Bart Van Assche
17c84b9ffb libprocessgroup: Introduce a local variable in CgroupMap::ActivateControllers()
This CL prepares for introducing an additional flag test.

Bug: 213617178
Change-Id: Ia74c1990792b5839f76498de2cac0008ed92040f
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-09 13:26:17 -08:00
Treehugger Robot
392eae64a8 Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/core" 2023-02-09 21:24:38 +00:00
Vova Sharaienko
75f860033c [TeX] Introduced Telemetry Express Histogram metric Native API
- added support C++ TeX Histogram logging API

Bug: 268161449
Test: atest expresslog_test
Change-Id: I284c6ceab42208dc9432fe3887c9ac000028d072
2023-02-09 21:21:33 +00:00
Automerger Merge Worker
5b6afde079 Merge "Merge "libsnapshot: Disable 32-bit VTS tests on 64-bit systems." into android13-tests-dev am: cb6ea9edb4" 2023-02-09 20:49:43 +00:00
David Anderson
d399c0312d Merge "libsnapshot: Disable 32-bit VTS tests on 64-bit systems." into android13-tests-dev am: cb6ea9edb4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2427052

Change-Id: Ice8dd4ea2421b86c520356cfc83944364eafbcad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-09 20:49:35 +00:00
David Anderson
cb6ea9edb4 Merge "libsnapshot: Disable 32-bit VTS tests on 64-bit systems." into android13-tests-dev 2023-02-09 20:10:05 +00:00
Bob Badour
ce88220fa1 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  rootdir/Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I19aaea76a932cc928bbc178c01a33fdc98b0cf16
2023-02-09 11:29:51 -08:00
Dmitrii Merkurev
91297172eb fastboot: Introduce network-connected devices storage
Bug: 267507577
Bug: 267505625
Test: tested file lock api works on linux/windows
Test: tested storage api works on linux/windows
Change-Id: I33dda819370900310ae7fc63cbf6b00ba22ad4e8
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-09 16:28:17 +00:00
David Anderson
8fc623eb63 liblp: Fix a crash when adding an image to a partition with no extents.
Bug: N/A
Test: lpmake --partition=system:readonly:0 --image=system=system.img
Change-Id: I4de616cc1b9ca2838d38518ec24a382f4bc1b1be
2023-02-08 22:09:58 -08:00
Daniel Rosenberg
2f0508686e Only run GentleKill test as root
Without root, Service::Start() fails due to lack of permissions.

Bug: 267559075
Test: run cts -m CtsInitTestCases -t init#GentleKill
      atest init#GentleKill
      Will skip under cts, pass under atest
Change-Id: I69e8be7000718bdba1c2acd9675b5645c0891afc
2023-02-08 17:31:49 -08:00
David Anderson
86e869a566 fastboot: Add fastboot_test to TEST_MAPPING.
Bug: N/A
Test: fastboot_test on host
Change-Id: I1947b371ba6117e6eed811d1d6e1ed4019e0a0e9
2023-02-08 15:03:51 -08:00
David Anderson
33e044574a libsnapshot: Disable 32-bit VTS tests on 64-bit systems.
These tests don't work because 32-bit dependencies are not normally
packaged on a 64-bit system.

Bug: 263062262
Test: builds
Change-Id: I68859a9e9c029a528ee12c02569a3693261c7251
(cherry picked from commit 32fa3e96f4)
2023-02-08 18:59:43 +00:00
David Drysdale
d0149e8e9a Convert Gatekeeper from HIDL to AIDL
Replaced HIDL spec implementation with AIDL spec in gatekeeper
module. Based on the changes in aosp/2161796.

Bug: 268342724
Test: VtsHalGatekeeperTargetTest, CtsVerifier
Change-Id: Ic322e5c5a7d0577df28410a546cbad88549158bc
2023-02-08 18:41:56 +00:00
Mitch Phillips
22387708fc Merge "Recoverable GWP-ASan: Don't tell ActivityManager" 2023-02-08 18:14:19 +00:00
David Anderson
40bb403c45 Merge changes I72cf6f52,I9620e5b4
* changes:
  libsnapshot: Fix crash in cow writer test due to missing ASSERT.
  libsnapshot: Improve low space tests.
2023-02-08 04:03:55 +00:00
Mitch Phillips
8fe5127027 Recoverable GWP-ASan: Don't tell ActivityManager
Currently, debuggerd tells the teacher that an app that received a fatal
signal. On the playground, dobbing on a process that doesn't actually
need to be killed is considered a friendship-ending move.

Because recoverable GWP-ASan is *supposed* to not crash your app,
suppress this behaviour and don't let ActivityManager know about the
crash.

Bug: N/A
Test: Run a use-after-free in an app that's using recoverable GWP-ASan,
through the 'libc.debug.gwp_asan.recoverable.<app_name>=1' and
'libc.debug.gwp_asan.process_sampling.<app_name>=1' sysprops.

Change-Id: I033ea67d577573df10936e37db7302d4f4bc0069
2023-02-07 17:06:32 -08:00
Daniel Zheng
166efb16c7 Merge "Created new Task.h file to contain task classes." 2023-02-07 21:03:20 +00:00
Treehugger Robot
525c8bbc08 Merge "UDC: Dm-Bow failed to load when size is not Multiple of 4096" 2023-02-07 18:44:37 +00:00
Treehugger Robot
bb794847d4 Merge "storageproxyd: Add watchdog to log stuck requests" 2023-02-07 06:04:17 +00:00
David Anderson
bda181a86a libsnapshot: Fix crash in cow writer test due to missing ASSERT.
Bug: N/A
Test: vts_libsnapshot_test
Change-Id: I72cf6f52fc15061da669d14cf5d334b44ad83501
2023-02-07 05:24:27 +00:00
David Anderson
111bec1e90 libsnapshot: Improve low space tests.
These tests have historically been pretty flaky, and have gone through a
few rounds of improvement. This is yet another: remove the
parameterization, so we can test that at least one variant of the test
succeeds, rather than all of them.

Filesystems (especially F2FS) have a lot going on underneath the hood,
and there's no guarantee that precise free space can be allocated,
measured, or relied upon in the ways this test expects. And all that we
really need to test is that some kind of out-of-space error can be
triggered.

Bug: 266645706
Test: vts_libsnapshot_test
Change-Id: I9620e5b496d5020b21cc37074e87dd21fc419ed2
2023-02-07 05:24:26 +00:00
Treehugger Robot
d019150a00 Merge "Add bug component id to OWNERS" 2023-02-07 02:44:56 +00:00
Daniel Zheng
1a01a1cda1 Created new Task.h file to contain task classes.
Test: tested Reboot {target} + Flash {partition} on raven device
Bug: 194686221
Change-Id: I0d80230d682f80af12cca9705df0172651bf4461
2023-02-06 23:58:13 +00:00
Treehugger Robot
57a935613c Merge "fastboot: Fix missing endian header in fastboot_driver.h to avoid header confusion" 2023-02-06 22:08:12 +00:00
Stephen Crane
0255766d6b storageproxyd: Add watchdog to log stuck requests
Adds a background watchdog thread to the Trusty storageproxy to monitor
and log any requests that are delayed for too long. This is intended to
assist in recognizing and debugging any sources of hangs related to
servicing Trusty storage requests in Android.

Test: Add sleep() and run trusty storage tests
Bug: 266595872
Change-Id: I98dfaff0dff04f97d5c657ee131e746f63b39739
2023-02-06 21:39:19 +00:00
William McVicker
ba16edbdd2 Merge "Revert "libmodprobe: LPM: Load all modules in *.load with *.dep satisfied"" 2023-02-06 20:03:19 +00:00
William McVicker
a0e6703f73 Revert "libmodprobe: LPM: Load all modules in *.load with *.dep satisfied"
This reverts commit 3e6c9dbee8.

Reason for revert: This is breaking boot on several devices.
Bug: 267836481
Bug: 261678056
Change-Id: I67c4b784936828c448a53e3092af70d949fcbc65
2023-02-06 19:36:37 +00:00
Jiyong Park
078cc15b00 Add bug component id to OWNERS
Bug: 261015504
Test: N/A
Change-Id: I07d951e0bc551f2e642ffc2ee1aaeca2b7e77626
2023-02-06 07:39:56 +00:00
Treehugger Robot
7eb6dc9104 Merge "Fix a spelling error" 2023-02-06 05:08:18 +00:00
John Stultz
3f061f9813 fastboot: Fix missing endian header in fastboot_driver.h to avoid header confusion
So fastboot_driver.h includes <android-base/logging.h>, but that
file has a dependency on <android-base/endian.h>. So if
fastboot_driver.h gets included somewhere before
<android-base/endian.h>, it results in *very* opaque error
message:

system/core/fastboot/fastboot.cpp:1490:9: error: expected unqualified-id
        LOG(VERBOSE) << "Cannot optimize flashing super on non-AB device";
        ^
system/libbase/include/android-base/logging.h:221:23: note: expanded from macro 'LOG'
                      ^
system/libbase/include/android-base/logging.h:227:4: note: expanded from macro 'LOGGING_PREAMBLE'
  (WOULD_LOG(severity) &&                                                                  \
   ^
system/libbase/include/android-base/logging.h:202:40: note: expanded from macro 'WOULD_LOG'
  (UNLIKELY(::android::base::ShouldLog(SEVERITY_LAMBDA(severity), _LOG_TAG_INTERNAL)) || \
                                       ^
system/libbase/include/android-base/logging.h:174:26: note: expanded from macro 'SEVERITY_LAMBDA'
  using ::android::base::ERROR;               \
                         ^
prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/include/wingdi.h:75:15: note: expanded from macro 'ERROR'
              ^

This patch includes <android-base/endian.h> before
<android-base/logging.h> to avoid this issue.

Reported-by: Daniel Zheng <zhengdaniel@google.com>
Signed-off-by: John Stultz <jstultz@google.com>
Change-Id: I8752f2cdbef5b13901f0f4e8adfe60a21db785b6
2023-02-04 04:06:48 +00:00
William McVicker
bbe848abdf Merge "libmodprobe: LPM: Load all modules in *.load with *.dep satisfied" 2023-02-04 00:34:13 +00:00
Mitch Phillips
6e0eb996b3 Merge "Add recoverable GWP-ASan." 2023-02-03 18:35:08 +00:00
Bart Van Assche
dcc208f38a Fix a spelling error
Fixes: 2e4b3ffa75 ("Use Apex sepolicy if it's available")
Change-Id: Ib937fa8384658f05ff435024f7834c5df12f0d22
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-02-02 22:31:51 +00:00
David Anderson
15d7230ed6 Merge "fastboot: Avoid reboots to userspace when using flashall/update." 2023-02-02 17:34:29 +00:00
Alex Hong
4c80eb13aa Merge "Reland "Set the log callback earlier for showing system property set denials"" 2023-02-02 14:04:35 +00:00
Kelvin Zhang
a0427c41c1 Merge "Set output value in error case" 2023-02-02 03:59:16 +00:00
Greg Kaiser
451dfee3c7 Set output value in error case
We want to set the contents of "out_size_num_byte", and not
the pointer value, in the error case.

Bug: 266757931
Change-Id: I02edddcbcc4fc80dbb61efe8dc7c45bd3ce1c904
Test: TreeHugger
2023-02-02 00:05:21 +00:00
Mitch Phillips
18ce54241c Add recoverable GWP-ASan.
Recoverable GWP-ASan is a mode landed upstream in
https://reviews.llvm.org/D140173. For more information about why/what it
is, see
https://android-review.git.corp.google.com/c/platform/bionic/+/2394588.

This patch makes debuggerd call the required libc callbacks for GWP-ASan
to recover from the memory corruption. It also adds the functionality
that libart/sigchain eventually ends up calling, which dumps a GWP-ASan
report for the first error encountered.

Test: Build the platform, run sanitizer-status in recoverable mode,
asserting that it doesn't crash but we get a debuggerd report.
Bug: 247012630

Change-Id: I27212f7250844c20a8fd1e961417cdb4e5bd3626
2023-02-01 15:25:29 -08:00