Commit graph

80364 commits

Author SHA1 Message Date
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
David Anderson
7cf627bac9 Merge changes Ib744d763,I74278bb5,I3d240d6e,I1b41d233
* changes:
  fastboot: Move some helpers into util.h/.cpp.
  fastboot: Allow using LOG().
  fastboot: Use RAII for sparse_file objects.
  liblp: Add a helper class for building sparse-compatible super image layouts.
2023-02-01 21:27:03 +00:00
David Anderson
4c96a1673e Merge "OTA: make lp_metadata write more atomic" 2023-02-01 19:54:44 +00:00
David Anderson
667b1efadd fastboot: Avoid reboots to userspace when using flashall/update.
Reboots to fastbootd (userspace fastboot) take a long time, particularly
due to the orange AVB screen and the likelihood of devices having uart
enabled. For "flashall", there is rarely a need to actually go into
userspace, because all of super is getting thrown away. We can just
flash super in the bootloader.

In the past we didn't do this because computing super.img is expensive -
both in terms of time (due to reading dependent images) and in terms of
space (it's easily over 5GB).

But we don't actually need to fully compute super.img. We can build a
sparse_file containing the metadata/headers, with additional references
to each image file containing partition data. Liblp provides the API to
do that, and here, we simply need to translate the layout to libsparse.

On Pixel, this reduces flashall time by around 35-50 seconds, or around
20% of total time, depending on whether uart is in use.

There are some caveats, in which case we'll fall back to normal
fastbootd. This does not work on non-A/B devices, on retrofit dynamic
partition devices (Pixel 3), and in some other edge-casey scenarios. If
it fails, -v will add logging information about why.

Bue: 266982466
Test: fastboot flashall on Pixel 5+
Change-Id: Ie040da597d739faa7f834202184cec8f8e412076
2023-02-01 11:28:18 -08:00
David Anderson
aa87dc5a0d fastboot: Move some helpers into util.h/.cpp.
Bug: 266982466
Test: builds
Change-Id: Ib744d763e11d8a7f7e3f417b331defff61fe4559
2023-02-01 11:28:16 -08:00
Edward Liaw
b52704a608 Merge "sched_policy_test: set_sched_policy also set the cpuset policy as fallback" 2023-02-01 19:19:19 +00:00
David Anderson
a67fc32a8a fastboot: Allow using LOG().
The die() and verbose() macros are not really standard for AOSP. To
allow a gradual transition off them, call InitLogging on startup. This
will also allow seeing liblp logs when -v is passed.

Bug: 266982466
Test: builds
Change-Id: I74278bb5f698edb0dc81477a575b130b0bd11cdf
2023-02-01 11:09:29 -08:00
David Anderson
a1c983e800 fastboot: Use RAII for sparse_file objects.
Bug: 266982466
Test: fastboot flash
Change-Id: I3d240d6ecc8a37d968ffdef9d50e349e787e8d3e
2023-02-01 11:09:28 -08:00
Christopher Ferris
df10bfa19f Merge "Display offset in backtraces if necessary." 2023-02-01 18:12:12 +00:00
Zhou Xuezan
45eee7fe52 OTA: make lp_metadata write more atomic
Powerloss of OS failure occurs when super is merging,
then the device can't bring up again for no lp_metadata sync,
so make lp_metadata sync in time.

Change-Id: I1ea31662b838e35022a566b614796f2d5e05df4b
Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
2023-02-01 08:17:38 +00:00
Edward Liaw
d5ffbdfc56 sched_policy_test: set_sched_policy also set the cpuset policy as fallback
get_sched_policy uses the cpuset policy as fallback if the cpu cgroup
is not recognized.  Pixel is currently not using the cpu cgroup for
background policy due to b/208895940.

Bug: 265852986
Test: atest libcutils_test:libcutils_test.SchedPolicy#set_sched_policy -- --abi arm64-v8a
Change-Id: Ia77ace7513c48b1a14290c6ecc0222b46d6bf927
Signed-off-by: Edward Liaw <edliaw@google.com>
2023-02-01 03:06:45 +00:00
David Anderson
e6cef616f1 liblp: Add a helper class for building sparse-compatible super image layouts.
This class helps export a list of regions comprising a super partition,
and what the contents of those regions should be. It is very similar to
ImageBuilder, except that it does not require actual partition image
files, nor does it actually write an image file to disk.

The goal is to support building an in-memory super image that uses as
little memory and backing storage as possible. For example, fastboot can
use this to upload a super image without having to read and write
gigabytes of unnecessary data.

Since the goal is to optimize fastboot, we've taken some shortcuts here.
Retrofit devices and other edge-casey behavior are safely rejected. We
also don't rely on libsparse behavior here, and attempt to make the
translation to sparse records as trivial as possible, by explicitly
declaring where fill/dontcare gaps are, and only exporting 4KB aligned
regions. Hopefully this will allow the code to be portable to
non-fastboot consumers.

Bug: 266982466
Test: liblp_test
Change-Id: I1b41d233bc4512c4b62e19603e8e77bc5867cfab
2023-01-31 18:46:35 -08:00
Christopher Ferris
22035ccb01 Display offset in backtraces if necessary.
When moving to a proto tombstone, backtraces no longer contain
an offset when a frame is in a shared library from an apk.
Add the offset display again if needed, and add a test to
verify this behavior.

Bug: 267341682

Test: All unit tests pass.
Test: Dumped a process running through an apk to verify the offset
Test: is present.
Change-Id: Ib720ccb5bfcc8531d1e407f3d01817e8a0b9128c
2023-01-31 17:53:45 -08:00