Bug: 140882488
Test: Booted twice, checked logs to ensure encryption
is different each time, adb created files in directory.
Change-Id: I44f746acd1040f7baa9123d4824ba39b194f287b
libcrypto performs a self test when it is loaded, unless
a marker file /dev/boringssl/selftest/[hash] exists which
indicates that the self test has already successfully
completed since the last time the device was booted.
Before this CL topic, libcrypto attempted to create the
marker file when the self test successfully completed.
On Android, dedicated boringssl_self_test{32,64} binaries
are run early during boot and are the only binaries
(apart from init and vendor_int) that have permission to
create these files.
Another CL in this topic stops the boringssl self test
creating a marker file unless the environment variable
BORINGSSL_SELF_TEST_CREATE_FLAG is set to a nonempty value.
This CL sets that value to "true" when running the dedicated
self test binaries, but not for other binaries. This has
the effect that other binaries that run the self test
early during boot (before the dedicated self test binaries
have created the marker files) and which run the self test
will no longer attempt to create the marker file, which
SELinux would have denied anyway.
Bug: 137267623
Test: Treehugger
Change-Id: I99317df1a8c3496d33ae83f9ec346782b2286ac9
This replaces the recently added `exec_reboot_on_failure` builtin, since
it'll be cleaner to extend service definitions than extending `exec`.
This is in line with what we decided when adding `exec_start` instead
of extending `exec` to add parameters for priority.
Test: `exec_start` a service with a reboot_on_failure option and watch
the system reboot appropriately when the service is not found and when
the service terminates with a non-zero exit code.
Change-Id: I332bf9839fa94840d159a810c4a6ba2522189d0b
We already know 'existing_extent' is non-null (or else we would
have crashed on the previous line). We fix this to check
'existing_linear_extent' against nullptr.
Test: TreeHugger
Change-Id: I03338bca87d1c2bd0cbea0e1ec31244ba9570a40
init_first_stage is built in Make and statically links libcrypto,
so it needs to set LOCAL_INJECT_BSSL_HASH to make the FIPS self
test pass.
Bug: 137267623
Test: m checkbuild
Change-Id: Icd8ec07b731228a162db9a13d7304bf1d73127aa
This should ensure that the self tests run before any other binaries
that load libcrypto and which would otherwise run into SELinux denials
trying to create the marker file /dev/boringssl/selftest/[hash]
The invocation of the self test binaries from the Conscrypt apex
requires the apex to be mounted so it remains at a later point in
the boot process.
Bug: 137267623
Test: Treehugger
Change-Id: I34266d6e9d2f394fffa8a2c7725479b5770d119c
...so that it can be used by other tests.
Also, clean up the code before exposing it.
Test: libsnapshot_test
Test: liblp_test
Change-Id: I627326f696ea55b7113ff26b313f7dd04e341dc1
* changes:
libsnapshot: tests for public APIs.
fastbootd: skip COW group
libsnapshot: no overlayfs during virtual a/b ota.
libsnapshot: Also use empty space in super for COW
libsnapshot: APIs for all partitions
fs_mgr: CreateDmTable takes CreateLogicalPartitionParams
Userspace may want to load a different firmware than the one that the
kernel requests in some cases, therefore this change adds the ability
to ueventd to run an external handler that will determine the name of
the file that should actually be loaded.
Bug: 138352500
Test: unit tests
Change-Id: Ic5da37268fd78109f83ae52d1b903bf7322a5ee5
We regressed handling of the old host transport selection syntax, which
broke users that reimplement adb themselves (e.g. Studio via ddmlib).
Bug: https://issuetracker.google.com/140369526
Test: adb raw "host-serial:822X0028S:forward:tcp:42929;localabstract:/com.example.ndktest-0/platform-1568299082100.sock"
Test: ./test_device.py
Change-Id: Iaaec8fde952316fe9bf2a6f6c6c4a3bc9f74bf72
Skip importing COW group because they are dynamically
created by OTA clients and will never show up in built
images.
Test: flash
Change-Id: I44e7693cfb4c15e64455b56212a02f9abde88d61
With overlayfs enabled, the scratch partition takes up
super partition, causing retrofit devices to create COW
images.
Test: OTA on retrofit device, no COW images created.
Change-Id: I35a1a2d02c8acf9efc33965c7e015f960bf45296
The super partition usually has some empty space even after
the target partitions are created, especially for retrofit
Virtual A/B devices. Use that empty space for COW before taking
up userdata space.
- PartitionCowCreator computes free regions in super partition metadata
and use that space until it is used up. It returns a pair of numbers
(cow_partition_size, cow_file_size) and let SnapshotManager to create
the partition / images with proper sizes.
- A region is considered free iff it is used by NEITHER target NOR
source partitions
- The list is in PartitionCowCreator's return value so that
SnapshotManager can use it as a guide when creating partitions.
- These partitions are created under the group named "cow".
- Avoid mapping COW partitions directly during init first stage
mount. Init only maps them when they are needed by the top-level
device.
- CreateCowImage no longer zero-fills the first 4 bytes of the image.
(See below)
- CreateUpdatePartitions: after creating the snapshot, also maps the COW
devices (via MapCowDevices()) and zero-fills the first 4 bytes of the
top-level COW device.
- Add a new SnapshotManager::MapCowDevices() function, which maps both
the COW partition (in super) and the COW image (through
IImageManager) (if necessary). Then, create a dm-linear target that
concatenates them (if necessary).
- Add a new SnapshotManager::UnmapCowDevices() functions that does the
reverse MapCowDevices().
- DeleteSnapshot also unmaps the top-level COW device and COW partition
before unmapping the COW images (before deleting them).
Test: libsnapshot_test
Change-Id: I0098b7e842ab48b0b4dd2a59142098b098d23d34
Add CreateCowForUpdate / MapSnapshotDevicesForUpdate
that update_engine and init can call them directly.
Bug: 134536978
Test: libsnapshot_test
Change-Id: If53c48855931db27454fd2893745915c77fd37f8
It has too many arguments.
Also fixed CreateLogicalPartitionParams::InitDefaults because
it doesn't use the provided partition opener to read metadata
(which breaks tests).
Test: libsnapshot_test
Test: liblp_test
Change-Id: I74cf8d468274f741c6f3743438fe8855b2aef15b
This prevents us from using glibc's <fts.h> because of
https://sourceware.org/bugzilla/show_bug.cgi?id=11460,
and we now only support 64-bit hosts.
Bug: 139544611
Test: Treehugger
Change-Id: Iaacc9ea17473201bf3d701e82081264921062d5e
The accidental trailing ':' appears to stop the line
triggering.
Bug: 137267623
Test: Checked the /system/bin/boringssl_self_test32
now runs on aosp_cf_x86_phone-userdebug
Change-Id: I7b4b1d6b838d8d1a7a0db7f104a94b34962df030
Make sure system heap is present on devices, its id is '0',
and that we can allocate and free buffers from the system heap
Bug: 140507100
Fixes: 140507100
Tests: ion-unit-tests --gtest_fiter=SystemHeap.*
Change-Id: Ief502c9fce1e54f54b4e6d60f288954e4bf42e04
Signed-off-by: Sandeep Patil <sspatil@google.com>
Previously, the device path for the -inner device is used, which
may not be present. Use the major:minor instead.
Test: libsnapshot (not flaky)
Change-Id: I8b8cbe8af27a49a50876385bb0c0353ecf7ed1de