This change adds a missing pointer dereference to the InterceptResponse
when checking for a size mismatch.
Test: build
Bug: N/A
Change-Id: I88afed6f1c0f33fe237d337b0fb8fc0a0c0e3bac
libselinux log messages usually end with a new line character. Android
log system does not require the new line character and will include the
character as-is in the log buffer.
This trimming was already implemented when the message is typed as
SELINUX_AVC (see SelinuxAvcLog). Move the truncation one level up so it
is occurring for all types of logs.
Test: boot & adb logcat & inspect SELinux logs
Change-Id: I360359c1b178ef24d555dd41f8d4a18b293a175c
If you need to use the replace command, but you can't find it in the
usage list.
Change-Id: I8618ce4b0eff30507fc8846f76aaf858b1a6895e
Signed-off-by: mingzhu.wang <mingzhu.wang@transsion.com>
cleaning up main() code in fastboot.cpp to run off one task vector. The
eventual goal is to just have all functionality run off this vector.
Test: tested commands on raven
Bug: 194686221
Change-Id: I98d0ba33091eff31ff1bc338766c3689ffb54746
Modifying fastboot-info.txt to directly call reboot fastboot instead of
reboot userspace -> so no longer need "userspace" in reboot task. Also
moving skip_reboot check to task since in old code we can have
skip_reboot be true and still reboot to bootloader, fastboot, or
recovery
Test: tested reboot commands on Raven
Change-Id: I98ba51747bf7229a88ba737540c81d20b42e5981
Doesn't look like we actually need current_slot, since we can always
just call function get_current_slot
Test: tested flashall on raven
Change-Id: Icba64bc9fdd08f36d44965e32558a73d0beab0e1
Changed so if we call wipe on a partition that doesn't exist we'll get
some helpful error messages.
Test: tested wipe test
Bug: 194686221
Change-Id: I19dc0396a7a98d0b2be7859edbffeb8acdc9850a
is_logical shouldn't work in bootloader for some devices, so we also need to check
using should_flash_in_userspace to see if partition is dynamic
Test: tested to flash {partition} on raven and checked to see avb
footers are not copied from dynamic partitions
Change-Id: Iabb3ea535fa80b26cf1c08040beb3d4ea5e8c2ae
Cuttlefish tooling need libmodprobe to determine if a kernel module is
signed.
Bug: 273752147
Test: th
Change-Id: Icea49802d032b27bd89ed8f0bee1bc4814298774
Based on a new system property. This won't change any behavior if that
new system property isn't set.
Ignore-AOSP-First: WearOS specific change
Upstreaming from Wear: b/272526799
Bug: 199404658
Test: set the property, check that off-mode-charging automatically
reboots
(cherry picked from commit 332b3686290af70c73a464ce35b0c1124b2ce831)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:82d8011f170d5b1c936d117f4fb74836333714b6)
Merged-In: I98f37a840a43cb5216319457027b76fc493e3f62
Change-Id: I98f37a840a43cb5216319457027b76fc493e3f62
NOTE FOR REVIEWERS - original patch and result patch are not identical.
PLEASE REVIEW CAREFULLY.
Diffs between the patches:
0,6 +620,18 @@
kick_animation(&batt_anim_);
}
health_info_ = health_info;
+
+ if (property_get_bool("ro.charger_mode_autoboot", false)) {
+ if (health_info_.battery_level >= boot_min_cap_) {
+ if (property_get_bool("ro.enable_boot_charger_mode", false)) {
+ LOGW("booting from charger mode\n");
+ property_set("sys.boot_from_charger_mode", "1");
+ } else {
+ LOGW("Battery SOC = %d%%, Automatically rebooting\n", health_info_.battery_level);
+ reboot(RB_AUTOBOOT);
+ }
+ }
+ }
}
int Charger::OnPrepareToWait(void) {
Original patch:
From 82d8011f170d5b1c936d117f4fb74836333714b6 Mon Sep 17 00:00:00 2001
From: Alice Sheng <alicesheng@google.com>
Date: Fri, 18 Mar 2022 10:25:31 -0700
Subject: [PATCH] Add ability to automatically bootup
Based on a new system property. This won't change any behavior if that
new system property isn't set.
Ignore-AOSP-First: WearOS specific change
Bug: 199404658
Test: set the property, check that off-mode-charging automatically
reboots
Change-Id: I98f37a840a43cb5216319457027b76fc493e3f62
(cherry picked from commit 332b3686290af70c73a464ce35b0c1124b2ce831)
---
- Adding allowance for arbitrary ota subreason details, such as
success or failure conditions
- Adding the new subreason "periodic", which is useful for POS devices
which require e.g. daily reboots as part of security requirements
Test: Full Android build
Change-Id: Id0a6d38ed902e2b25fbb050980c763912c948f27
Signed-off-by: David Tracy <dtracy@squareup.com>
Due to https://r.android.com/1310496, sparse_file_write() splits all
blocks larger than 64 MiB. However, the code that splits file-backed
blocks copies the pointer to the filename without duplicating the
underlying memory, causing a double free in backed_block_destroy()
later. Fix this by using strdup(). Also, as long as that is being
fixed, also check for failure.
Test: SANITIZE_HOST=address mmm external/e2fsprogs
mkdir mnt
mkfs.ext4 img 1G
sudo mount img mnt
sudo cp /dev/urandom mnt/file
sudo umount mnt
ext2simg img simg
Before this fix it gave:
==2216498==ERROR: AddressSanitizer: attempting double-free on 0x602000000090 in thread T0:
#0 0x55a52454c9a2 in free out/stage2/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/out/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:52:3
#1 0x7ffa247c82ee in backed_block_destroy(backed_block*) system/core/libsparse/backed_block.cpp:106:5
#2 0x7ffa247c82ee in backed_block_list_destroy(backed_block_list*) system/core/libsparse/backed_block.cpp:124:7
#3 0x7ffa247cd055 in sparse_file_destroy system/core/libsparse/sparse.cpp:49:3
#4 0x55a524587b75 in main external/e2fsprogs/contrib/android/ext2simg.c:239:2
Change-Id: I4607ef5adcf6512645342beaf91aff6033414e54
Legacy snapuserd had xor optimizations implemented since at the time the
userspace snapshot implementation was a work in progress. We forgot to
ultimately remove the legacy xor code however, so let's do that now.
This should have no impact on devices. An S-frozen device will not be
getting this code because there's no vendor update happening. A T-frozen
device will be using userspace snapshots.
The only scenario this could happen is if a device starts on S vendor,
upgrades to T vendor, enables xor compression, and then updates to U
vendor. This configuration is not supported. Any device with a T+ vendor
should be using userspace snapshots.
Bug: N/A
Test: vabc_legacy_tests
Change-Id: If484a53cb0527393898a7ea703ba6f12d4c9a310
Since aosp/929692, this variable has been discard.
Test: manual
Signed-off-by: zhangyongpeng <zhangyongpeng@xiaomi.com>
Change-Id: I164766c9af06c0c19bc19b258cb866ed7cf36853
A user ID (uid) must be greater than or equal to zero to be valid. Only
strictly positive process IDs are valid. Add argument checks in
libprocessgroup of uid and pid arguments to make it easier to determine
the origin of invalid arguments.
Change-Id: I8a6d96ca4576bc9c329498c6a804dd05a02afca5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This removes the temporary daemon and socket and instead directly embeds
SnapshotHandlerManager. We can also remove the test flags for io_uring
as with this they're no longer necessary.
Bug: 269361087
Test: snapuserd_test
Change-Id: I728186d9bc90c98fabd76d3f86569840488ada96
These are only used for a single switch statement. Just compare the
input strings instead.
Bug: 269361087
Test: builds, ota applies
Change-Id: Ib90ae55309ea99c181585c64ed2ac814e5ed6c72
This splits server into two classes: one that handles the IPC requests,
and one that managers snapshot handlers. This will allow embedding of
the snapshot handling code, without booting up a server. It'll also make
testing much easier.
The handler code has been further placed behind a virtual interface,
though this is likely unnecessary unless we start testing the server
logic itself (or attempt to unify the S and T+ versions of snapuserd).
Bug: 269361087
Test: ota
Change-Id: I3ca3ad9c8c1fb910a1c7bf9f44165e2f44c930c9
There are multiple use cases in Android for which background writes need
to be controlled via the cgroup mechanism. The cgroup mechanism can only
control background writes if both the blkio and memcg controllers are
mounted in the v2 cgroup hierarchy. Hence this patch that migrates the
blkio controller from the v1 to the v2 cgroup hierarchy.
The blkio controller has been marked as optional since not all Android
kernels enable this controller (CONFIG_BLK_CGROUP).
This patch increases the TOTAL_BOOT_TIME for devices with a 4.19 kernel
(redfin) from 18.9 s to 20 s. This patch does not affect the boot time
for devices with a 5.10 or 5.15 kernel.
This patch increases the time spent in CgroupMap::ActivateControllers()
by 25 microseconds in Cuttlefish on an x86-64 CPU.
CgroupMap::ActivateControllers() is called by Service::Start().
Bug: 213617178
Test: Cuttlefish and various phones
Change-Id: I3c07c1be84c3feb277b7d7003652d5d3b57c6541
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This adds the missing assembler for riscv64, even though I don't have a
working tombstoned yet to test it with. There's a distinct possibility
we'll be back to fix the test (because although "register 1" is harmless
for the other architectures, it's the ra register on riscv64; the default
link register), but at least this lets us build the test.
I've also simplified all the assembly to be the simplest sequence I
know that writes 0 to address 0 (because if there was a reason to use
so many instructions before, I want to know what it is so I can write
the missing comment!).
Test: treehugger
Change-Id: I10d117eaedf361d9759a450e0973d07c4f97090e