Commit graph

72889 commits

Author SHA1 Message Date
Christopher Ferris
bb770d06c4 Merge "Add CHECK to verify assumptions in the code." am: bc6317592a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1839573

Change-Id: If9f8249b98ecd8922c4fdfaa941505f4a78b218c
2021-09-29 04:10:42 +00:00
Yi-Yo Chiang
aff8d4b02c Merge "init_first_stage: Remove unused srcs & static libs" am: 15ae358c71
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1838538

Change-Id: I73b198ae080e3aa1aa35d6471905bcf8902653c7
2021-09-29 04:10:36 +00:00
Christopher Ferris
bc6317592a Merge "Add CHECK to verify assumptions in the code." 2021-09-29 03:58:07 +00:00
Yi-Yo Chiang
15ae358c71 Merge "init_first_stage: Remove unused srcs & static libs" 2021-09-29 03:56:11 +00:00
Yifan Hong
10e5e5979a libsnapshot_fuzzer: allow ENXIO.
This is an accepted error code.

Fixes: 170395454
Test: run fuzzer

Change-Id: I93862c44f434878a6e1a1ed15a94c92d4a60611b
2021-09-28 19:32:55 -07:00
Treehugger Robot
fcb59b8f72 Merge "Replace test_min_api_level with test_options.min_shipping_api_level" am: 2d7301d235
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1838539

Change-Id: Ic3fb2995766540a714bf83e665553cd999587060
2021-09-29 00:14:59 +00:00
Treehugger Robot
2d7301d235 Merge "Replace test_min_api_level with test_options.min_shipping_api_level" 2021-09-29 00:02:04 +00:00
Christopher Ferris
2b98c82f05 Add CHECK to verify assumptions in the code.
On the main thread, the siginfo pointer will never be nullptr.
Add a CHECK to make sure this is true.

Test: Unit tests pass both 32 bit and 64 bit.
Test: Ran with debug.debuggerd.translate_proto_to_text set to 0
Test: to exercise old path.
Change-Id: I9d5ed0de5d652de8a4f9cd85eb57cbb1ec676404
2021-09-28 16:15:51 -07:00
Treehugger Robot
4e8f468aa0 Merge "Add VerifyMergeOps() to CowReader interface" am: bd69a74677
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1838573

Change-Id: I3e47f0be10e64e3fe6613655ad02b582d8bf585a
2021-09-28 20:58:32 +00:00
Treehugger Robot
bd69a74677 Merge "Add VerifyMergeOps() to CowReader interface" 2021-09-28 20:45:54 +00:00
Yi-Yo Chiang
bc35e823e9 init_first_stage: Remove unused srcs & static libs
Test: Build pass
Change-Id: Id79ad1cf1e66c34c9ef24776c417f40286941bc7
2021-09-28 20:22:45 +08:00
Justin Yun
43678b17a5 Replace test_min_api_level with test_options.min_shipping_api_level
Test options for the api levels are moved to test_options.
test_min_api_level property will be removed with this change.

Bug: 187258404
Test: build
Change-Id: Id943566de2ac693b5955bd84a8463e5013a8bb0f
2021-09-28 20:35:09 +09:00
Kelvin Zhang
f2e1f20fd7 Add VerifyMergeOps() to CowReader interface
update_engine only sees ICowReader, so in order for update_engine to
consume this API, it has to be in the base interface class.

Test: th
Change-Id: I9100b6aa1db6eb6a884752620098172bdd51f200
2021-09-27 18:26:23 -07:00
David Anderson
2374bd48ed Add a test for bug 198265278.
This test uses dependency injection to cause a failure in
QuerySnapshotStatus. We expect ProcessUpdateState to return MergeFailed.
The test also checks that if the merge is attempted again, it can
succeed.

Some duplicated code has also been factored out into the test harness.

Bug: 198265278
Test: vts_libsnapshot_test gtest
Change-Id: I6ccb434afa0e5ebf6781b2cec5277e3b7c210b77
2021-09-27 17:29:45 -07:00
Liangcai Fan
d884ba5916 adds LO_FLAGS_AUTOCLEAR for loop device of zram backing device
Userdata spaces leak when zram writeback is enable and repeatedly kill
system_server(restart android).
The reason is that per_boot‘s inode is hold by loop device
although per_boot is deleted by user which become orphan inode in system.

Adds LO_FLAGS_AUTOCLEAR for loop device of zram backing device,
so loop device can release resouce.

Bug: 200904398

Change-Id: Ifeee9c0b58b10cdf7698077fbcaf54d5faccc3b1
Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com>
Signed-off-by: Jing Xia <jing.xia@unisoc.com>
2021-09-26 10:07:50 +08:00
Christopher Ferris
f67a8e617f Merge "Disable scudo when using svelte config." am: be17619ccc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1836204

Change-Id: I219350e1f5b3e255919653746f4f96d5f3a90c2a
2021-09-25 01:54:53 +00:00
Christopher Ferris
be17619ccc Merge "Disable scudo when using svelte config." 2021-09-25 01:36:48 +00:00
Treehugger Robot
8355803863 Merge "libsnapshot: Add function to verify merge sequence" am: 5125c62cf8
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1828972

Change-Id: I1fa3eba99bb5ffa119e0d8560179d98b00ac3312
2021-09-25 01:07:09 +00:00
Treehugger Robot
5125c62cf8 Merge "libsnapshot: Add function to verify merge sequence" 2021-09-25 00:50:49 +00:00
Daniel Rosenberg
1e3fa94657 libsnapshot: Add function to verify merge sequence
This adds a function that verifies that the merge sequence does not
attempt to use blocks that have already been overwritten. It prints the
first such conflict to the logs.

Additionally, this adds a forwards merge iterator, and the ability to
ignore current progress in a merge for the purposes of verifying the
whole sequence.

This can be accessed via the VerifyMergeOps Function in Cow Reader, or
by using inspect_cow -v [COWFILE]

Include merged ops in inspect_cow listing with -a, and view ops in merge
order with -n

Bug: 200076590
Test: cow_api_test.InvalidMergeOrderTets
Change-Id: I893b9f8a8803cb6dd53225ec34224167b9fe2fda
2021-09-24 16:03:17 -07:00
Marco Nelissen
437597dd98 Merge "tipc_test: allow connecting to arbitrary services" am: d394f74700
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1832713

Change-Id: I11eb2196a2020c94cdde49d2a098acd27db3819c
2021-09-24 21:56:15 +00:00
Marco Nelissen
d394f74700 Merge "tipc_test: allow connecting to arbitrary services" 2021-09-24 21:42:06 +00:00
Marco Nelissen
0aae5be54f tipc_test: allow connecting to arbitrary services
Add an option to specify a service name. Currently only the "connect"
test supports this, and will try to connect to the named service
instead of the echo and datasink services.
Also fix the built-in help text, as it was missing the "burst" option,
and didn't mention that the "connect" test connects to both the echo
and datasink services.

Bug: 200034376
Test: run

Change-Id: I3903f94c16320f8e07ac4bfb69e3bb45329138c0
2021-09-24 20:14:24 +00:00
Tri Vo
0b71744db0 Merge "storageproxyd: Fix inverted conditional in error checking" am: 6aaac7cad9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1836533

Change-Id: I74f2c86019eafded7a8d8893a60dbb27cbc36654
2021-09-24 19:15:32 +00:00
Tri Vo
6aaac7cad9 Merge "storageproxyd: Fix inverted conditional in error checking" 2021-09-24 19:05:05 +00:00
Christopher Ferris
7aad2567ee Disable scudo when using svelte config.
This code was added, but a svelte config still tries to use scudo
related code that doesn't exist.

Bug: 201007100

Test: Ran unit tests on normal config.
Test: Ran unit tests on svelte config.
Change-Id: Ic84bae37717d213121aef182bac2f82dbee25213
2021-09-24 11:55:36 -07:00
Stephen Crane
bdb2eba4a4 storageproxyd: Fix inverted conditional in error checking
check_scci_sense (now renamed unexpected_scsi_sense) was supposed to
return false iff the sense data was valid and did not contain an error.
This return value was inverted. Invert the return values and rename the
function to clarify its role.

Test: m storageproxyd
Bug: 195544379
Change-Id: I3b84188aabe58345a83d2fd57bb8103e730cf365
2021-09-24 10:20:58 -07:00
Steven Moreland
575bce5ee8 strerror: incl enum name
strerror is nice, but usually I don't care about the text, I care about
the uppercase enum

Bug: N/A
Test: N/A
Change-Id: I8ea86220cb04cbded701379c47b8aba8ea8864b8
2021-09-23 21:29:50 -07:00
Yi-Yo Chiang
623fb83cb2 Merge "Reland: Add /system_ext/etc/selinux/ to the debug policy search path for GSI" am: 711b56e2a0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1834756

Change-Id: I6f9544179fea2a9685d13f067df58ad2046d1acb
2021-09-24 03:25:31 +00:00
Yi-Yo Chiang
711b56e2a0 Merge "Reland: Add /system_ext/etc/selinux/ to the debug policy search path for GSI" 2021-09-24 03:10:34 +00:00
David Anderson
8005743be4 Merge "libdm, libsnapshot: Add a virtual interface for DeviceMapper." am: 5cd741583f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1825107

Change-Id: I5b6aa6445809c808cf4d4cac8769f7d42cfe1bac
2021-09-23 22:39:48 +00:00
David Anderson
5cd741583f Merge "libdm, libsnapshot: Add a virtual interface for DeviceMapper." 2021-09-23 22:25:46 +00:00
Elliott Hughes
c75d25d172 Merge "libdebuggerd: fix process uptime." am: c00bfdcc9a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1832953

Change-Id: I2898dd4105171edc5d73e75e355973135f036044
2021-09-23 15:25:41 +00:00
Elliott Hughes
c00bfdcc9a Merge "libdebuggerd: fix process uptime." 2021-09-23 15:16:10 +00:00
Yi-Yo Chiang
bb77c544e5 Reland: Add /system_ext/etc/selinux/ to the debug policy search path for GSI
This change only *adds* /system_ext/etc/selinux to the debug policy
search path, and does not change any preconditions to load the debug
policy. The device still needs to be bootloader-unlocked and has the
debug ramdisk flashed to be able to use the debug policy. The only thing
changed is that now the debug policy can be loaded from /system_ext or
/debug_ramdisk when system partition is compliance testing GSI.

The debug policy in the boot ramdisk may be outdated if the system
partition is flashed with a image built from a different revision.
This happens frequently when running the compliance testing VTS, where
the device is flashed with (A) GSI and (B) device vendor image & debug
boot image, and (A) and (B) are built from different git revisions.

To address this, we install a copy of the debug policy under
/system_ext, so that the version desync between (A) & (B) wouldn't be a
problem anymore because (A) no longer relies on the debug policy file
from (B).

Bug: 188067818
Test: Flash RQ2A.201207.001 bramble-user with debug ramdisk & flash
  gsi_arm64-user from master, device can boot and `adb root` works
Change-Id: Ibe17eb1ecb0e813309c9596d1f152b7455686b26
2021-09-23 14:26:27 +00:00
Santiago Seifert
f60946a242 Merge "Revert "Add /system_ext/etc/selinux/ to the debug policy search ..."" am: 2b324f5642
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1834618

Change-Id: I8b3e938430736bbe1a42c173d167d66c397f88de
2021-09-23 13:33:47 +00:00
Santiago Seifert
2b324f5642 Merge "Revert "Add /system_ext/etc/selinux/ to the debug policy search ..."" 2021-09-23 13:25:55 +00:00
Santiago Seifert
be09a1e643 Revert "Add /system_ext/etc/selinux/ to the debug policy search ..."
Revert "Add a copy of debug policy to GSI system image"

Revert "Add PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT"

Revert "Add system_ext_userdebug_plat_sepolicy.cil for GSI"

Revert submission 1824717-gsi_debug_policy

Reason for revert: Breaks the build (see b/200933187).
Reverted Changes:
I37ef02628:Add a copy of debug policy to GSI system image
I9c3dad8bb:Add PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT
I43adc6ada:Add system_ext_userdebug_plat_sepolicy.cil for GSI...
I4d6235c73:Add /system_ext/etc/selinux/ to the debug policy s...

Change-Id: I2eb3b00abb981c25514b75b2e7b4b7b203653390
2021-09-23 13:07:25 +00:00
Yi-Yo Chiang
1e27e4b5da Merge "Add /system_ext/etc/selinux/ to the debug policy search path for GSI" am: d7f8cf483b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1824634

Change-Id: I6107412518294026723339a5de215593c1e6a1e7
2021-09-23 10:15:17 +00:00
Yi-Yo Chiang
d7f8cf483b Merge "Add /system_ext/etc/selinux/ to the debug policy search path for GSI" 2021-09-23 10:07:10 +00:00
Marco Nelissen
dd538a6ec9 Merge "trusty_apploader: log to stderr" am: e0e160c54b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1833093

Change-Id: I6a479aebdae6d13aecf4ebabdc592d095ca7bdba
2021-09-22 17:03:48 +00:00
Marco Nelissen
e0e160c54b Merge "trusty_apploader: log to stderr" 2021-09-22 17:01:30 +00:00
Mohammad Samiul Islam
954ab6ec55 Merge "libbinder: split out PackageManagerNative aidl" into stage-aosp-master 2021-09-22 10:28:10 +00:00
Elliott Hughes
32d3cdda22 libdebuggerd: fix process uptime.
I was here because we have a case where timeout(1) kills logcat, but
debuggerd alleges that the process that was killed had started less than
a second ago. I'm not sure this is the problem there, but I did notice
that far too many tombstones were claiming improbably short process
uptimes. It turns out that the code was measuring the *thread* uptime,
not the *process* uptime.

Also simplify the code a bit by switching to sysinfo(2) rather than
reading a file.

Test: manual, plus the existing unit test
Change-Id: Ie2810b1d5777ad9182be92bfb3f60795dc978b24
2021-09-21 17:30:30 -07:00
Marco Nelissen
92cd8891ff trusty_apploader: log to stderr
Print an error message to stderr on connection failure, so that the
command doesn't exit silently in case of the common user error of
forgetting to run it as root.

Bug: None
Test: Run as regular user, see "permission denied" message.
Change-Id: Ia213dedccab27e6152b5eb969fbee06d82d3d4ff
2021-09-21 15:51:58 -07:00
Marco Nelissen
b87e035e6a Merge "re-tab and clang-format tipc_test" am: 51fd280b8e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1831680

Change-Id: Iba910dc3e2481b6c06a089fdf2a4f4368d4f2202
2021-09-21 14:56:59 +00:00
Marco Nelissen
51fd280b8e Merge "re-tab and clang-format tipc_test" 2021-09-21 14:42:52 +00:00
David Anderson
efec0abf4a libdm, libsnapshot: Add a virtual interface for DeviceMapper.
It is difficult to test libsnapshot failures because there is no way to
inject failure scenarios into the kernel's device-mapper. Exposing a
virtual interface will allow this kind of testing via dependency
injection.

Bug: 199785546
Test: builds, tests pass
Change-Id: I5add0c7e24f7fa2853114eaeda7c479eaa4e0552
2021-09-20 22:13:20 -07:00
Marco Nelissen
7637d25ae0 re-tab and clang-format tipc_test
tipc_test.c used a mix of tabs and spaces for indentation and other
things that clang-format doesn't like, so retab and format it.

Bug: None
Test: build
Change-Id: I9b3a64bae54697d43e7fb39fe7d6e1dabe0be380
2021-09-20 17:10:05 -07:00
Treehugger Robot
a3d7000475 Merge "bootstat: add more bootreasons" am: c91c8f88e6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1813399

Change-Id: I7cb659bc1571000cf53bb6a74e8f54999baab759
2021-09-20 22:02:20 +00:00