There is more than one function that can allocate in the fallback
path. Therefore, make sure that all functions that can allocate have
switched to the fallback linker allocator before allocating. This
is mostly a problem for the trace_handler function call, which iterates
over all known threads and gets backtraces for them.
Add a ScopedUseFallbackAllocator class to do the switching to make it
easier to have the same code everywhere.
Add two tests to verify that no allocations are occuring during
a tombstone or backtrace on the fallback path. These tests are not
comprehensive since they can't verify that the linker allocator is
using the fallback allocator, but they are better than nothing.
Remove the debuggerd_fallback_tombstone() function since it only
enables the linker callback and then calls engrave_tombstone_ucontext().
The enabling is now done with the ScopedUseLinkerAllocator.
Restructure the case where sending the signal to a thread fails so
that the fallback allocator can be enabled properly.
Bug: 359692763
Test: Ran debuggerd -b <PID> and debuggerd <PID> on a process that
Test: goes throught the fallback path.
Test: Unit tests pass along with two new tests.
Test: Forced a fallback process to crash and verified tombstone generated.
Test: Instrumented the linker allocator and verified that the trace_handler
Test: function never calls the normal linker allocator as it runs.
Change-Id: I2710921076634eac97f41bec8c3a29c1d75ae5ec
Indentation in this file is four spaces, remove an
unnecessary trailing semicolon, put a space between
a type declaration and its structured binding.
clang-format shuffled a line around as well.
Bug: None
Test: compile
Change-Id: Ib4cf17fecb1e54971020dc77b7903d2aac5dd9c1
libsnapshot_init is linked by microdroid. Adding libselinux as whole_static_libs in `libsnapshot_defaults` will bloat the super image of microdroid.
Instead, statically link libselinux for libsnapshot_init.
On Pixel 7 Pro:
Microdroid super image: 47173836
Baseline (Without this change): 47161548
Bug: 362839899
Test: Build, verify microdroid super image size.
Change-Id: I3c589097173b305c1d39af9edbfb8c5e29f21410
Signed-off-by: Akilesh Kailash <akailash@google.com>
The new binary sets non-secure RoT for keymint. The non-secure
version will be used on cuttlefish.
Bug: 355194622
Test: CF is gets booted with KeyMint TA in VM
Change-Id: Iff202c6d4bb70dabeb866b4f3fbc18c006bb219e
We want to avoid the usage of size_t for any integer value that could
exceed 2^32 (for 32 bit platforms). Let's update the usage here for
future compatibilty and avoid silent truncation failures.
Bug: 361048795
Test: th
Change-Id: I9ce2ca21706270a218f06f7d2b7dc9fade185a68
F2FS does not support page_size!=block_size configuration, and
dev option devices need to toggle between 4K/16K mode, hence F2FS
requires a data wipe every time page size changes. This is inconveinent,
skip F2FS formatting instead.
Test: th
Bug: 353436188
Change-Id: Ic33dbc39c16db3aee4c47349a9693aacec240de8
snapshot metadata files are stored in /metadata. This means, we cannot
wipe after installing any update.
This patch does the following:
1: Create a scratch space in super partition. The scratch space for ota
metadata is just about 1MB.
2: Create ext4 filesystem on top of scratch block device.
3: Mount the scratch on /mnt/scratch_super
4: When snapshot-manager instance is created, point the /mnt/scratch/ota
to metadata_dir_ so that all the snapshot files are stored in the new
path.
All the logic of OTA remains the same. This flow is enabled only on userdebug builds for now and the only consumer would be snapshotctl
$snapshotctl apply-update /data/nbd/ -w
During init, we would have to mount the scratch partition to detect
if there is any pending updates.
With this, we would now be able to wipe the device along with the update flow. This will help incremental flashing wherein we would end up saving ~35-40 seconds on Pixel devices.
With this flow, the end-to-end update for incremental builds takes
~20-30 seconds.
Bug: 330744468
Test: Pixel 6 incremental flashing with wipe, Full OTA, vts_libsnapshot
Change-Id: Iac6ce2cf37b70ea221cd18175c8962988d03d95b
Signed-off-by: Akilesh Kailash <akailash@google.com>
/adb_keys will be moved to /product/etc/security as it's a
product-specific file. To prevent regression, /adb_keys will be a
symlink to the new location.
Bug: 353430323
Test: boot and connect adb with ADB_VENDOR_KEYS
Change-Id: I3dd200a1583be8f99bd5c30ecfed1bdc544ca783
If bootconfig hibernation_resume_device is present in boot config, then
we write that value to /sys/power/resume
Bug: 339688542
Test: Check resume from hibernation/boots with/without config present
Change-Id: I1a9bf63af4dab07e494740722898c1aba33c00b5
The kTagGranuleSize is only used in aarch64, so you can get
unused variable warnings for other targets. Move this definition
closer to where it's used and in aarch64 code.
Test: Build with unused checking on.
Change-Id: I9baf660430508ee3ca1efb62585ee1b038c6b0f3
We don't need this any more because the glibc headers have been updated, but it looks like it wasn't being used anyway.
Change-Id: Ie98ae473af504c49a8cae07fa06ec7f1568f662d
Init is responsible for initializing the /dev/[u]random entropy
pool, to ensure that high quality random numbers are available
to all Android processes. Previously Android mixed in data
from /system/etc/prop.default, which included properties which
differed on a device-by-device basis. That file no longer exists,
and init generates the following error at boot:
init: Command 'copy /system/etc/prop.default /dev/urandom'
action=init (/system/etc/init/hw/init.rc:106) took 0ms and
failed: Could not read input file '/system/etc/prop.default':
open() failed: No such file or directory
Instead of reading a property file, this change modifies init.rc
to read from /proc/bootconfig. The bootconfig file contains
per-device data which was previously on the command line, such
as androidboot.serialno. Additionally, it contains device-class
information such as androidboot.hardware,
androidboot.hardware.platform, and data which frequently churns
such as androidboot.vbmeta.digest. These help ensure that the
random number initialization is at least unique on a per
device-class basis.
Relying on /proc/bootconfig accomplishes the same goal that
relying on /system/etc/prop.default was intended to accomplish.
And /proc/bootconfig is in a more stable location than
/system/etc/prop.default, hopefully preventing future regressions.
Bug: 361624398
Test: Device boots and error above goes away
Change-Id: Id5c891e871217d62ff6517c5804b4acc2d723622
ro.boot.hardware.cpu.pagesize is used on some devices to
report the page size. However, we also know what value this
should be from the CPU. Rather than create a separate property
for this, standardize around this property.
This also allows us to test the value of this property on all
devices.
Bug: 358696947
Test: Vts16KPageSizeTest
Change-Id: I7f6260c68e17e7df8a789e9066a7171f3a56f4b0
Previously, ServiceParser did the check, but only when it's invoked by
host_init_verifier. Host_init_verifier can do it directly, which removes
unnecessary runtime dependencies from init.
Bug: 326827772
Test: host_init_verifier detects wrong HIDL interface names.
Change-Id: I4c8bb0e89a5def7341c48c52af730795a6ee13c0
CheckInterfaceInheritanceHierarchy() is for host_init_verifier to check
the interface names at buildtime. We don't need to fuzz the host-side
verification code.
Bug: 326827772
Test: run init_parser_fuzzer
Change-Id: Ie01dc2953fd6e69ef3c2cb9caadf7b9964a3d244
We will change the symbolizer to use this information to output
something like:
Potentially referenced stack object:
0 bytes inside a stack variable "variableName" in stack frame of function functionName
at source.cc:1234
Bug: 309446520
Change-Id: I1163ac81ac6b5e184387eb9e058d97a7227e3671