Commit graph

58480 commits

Author SHA1 Message Date
Tom Cherry
4f9fed24bc logd: add missing static to CompressionEngine
Test: build
Change-Id: I8b068e137835ce5e1ce2af1911f557cbcaca0fa2
2020-06-17 08:31:25 -07:00
Joshua Duong
cf88259783 Merge "[adb] Check for null in mdns connect info." 2020-06-17 01:23:54 +00:00
Joshua Duong
282385f823 [adb] Check for null in mdns connect info.
Adb client does not use these values, so just ignore it.

Bug: b/158824677

Test: 'adb -H 127.0.0.1 -P 5037 devices' does not crash.
Change-Id: I4dada6e5e1714157bbf1af370510dfa7bfbd6b17
2020-06-16 16:40:46 -07:00
Tom Cherry
e72b290c8e Merge "logging: Use more inclusive language." 2020-06-16 22:36:15 +00:00
Treehugger Robot
2ab39411eb Merge "libmodprobe: improve error reporting." 2020-06-16 22:22:13 +00:00
Tom Cherry
0efb410013 logging: Use more inclusive language.
Also generic syntax clean up and removing some unused aspects (sorting
the list and the TODO increasing performance based on this sorting).

Test: logging unit tests
Change-Id: I56bb3866c13cb4c28bd48665bf32ec620cf0278e
2020-06-16 14:31:31 -07:00
Treehugger Robot
f9033832cf Merge "llkd: Use more inclusive language" 2020-06-16 20:34:33 +00:00
Treehugger Robot
4db1b12b3c Merge changes I14ed0839,I59f9fde5
* changes:
  modprobe: Use more inclusive language for libmodprobe (Part Deux)
  modprobe: Use more inclusive language for modprobe and libmodprobe
2020-06-16 18:50:12 +00:00
Elliott Hughes
1ab2c02324 libmodprobe: improve error reporting.
Bug: http://b/159064719
Test: treehugger
Change-Id: Ie3ea73a934a30b4674b30fd3823f59f062418ac7
2020-06-16 11:48:28 -07:00
Mark Salyzyn
6d9e515905 llkd: Use more inclusive language
Documentation is synchronized to match external, to ease updating.

blacklist is replaced with ignorelist or ignore depending on context.

Test: none
Change-Id: I6db7ad321684759e3c5ac1f66f940b6e8a5709a0
2020-06-16 10:28:14 -07:00
Tom Cherry
1e412e7d4e Merge "logd: add a SerializedLogBuffer suitable for compression" 2020-06-16 16:55:25 +00:00
Tom Cherry
be42841c61 Merge "fsmgr: fix integer overflow in fs_mgr" 2020-06-16 16:54:48 +00:00
Mark Salyzyn
9debda17ab modprobe: Use more inclusive language for libmodprobe (Part Deux)
Remove blacklist

Test: none
Change-Id: I14ed08390a7db0b4b962343c61d60230751047ce
2020-06-16 05:14:09 -07:00
Treehugger Robot
a5032be8e0 Merge "init.rc: chmod pagetypeinfo to 440 to be captured in BRs" 2020-06-16 08:30:15 +00:00
Haoran.Wang
4a489450f4 fsmgr: fix integer overflow in fs_mgr
As the EXT4_MAX_BLOCK_SIZE defined as 65536 which reached maxium value
of unsigned int. The superblock value maybe larger than 65536. This is
found by the Integer Overflow Sanitizer.

This patch fixed below boot error when userdata is corrupted:
init: processing action (fs) from
(/vendor/etc/init/hw/init.freescale.rc:221)
init: [libfs_mgr]Invalid ext4 superblock on '/dev/block/by-name/userdata'
init: InitFatalReboot: signal 6 init: #00 pc 00000000000af7e8  /system/bin/init
(android::init::InitFatalReboot(int)+208) init: #01 pc 00000000000afbd0  /system/bin/init
(android::init::InstallRebootSignalHandlers()::$_22::__invoke(int)+32)
init: #02 pc 00000000000006bc  [vdso:0000ffff9691b000] (__kernel_rt_sigreturn)
init: #03 pc 000000000004e070  /system/lib64/bootstrap/libc.so (abort+176)
init: #04 pc 000000000003427c  /system/lib64/libfs_mgr.so
(read_ext4_superblock(std::__1::basic_string<char, std::__1::char_
traits<char>, std::__1::allocator<char> > const&,
android::fs_mgr::FstabEntry const&, ext4_super_block*, int*)+1804)

Test: boot with corrupted ext4 superblock

Change-Id: I58ed723afa9975d0e93f96fad7c55465e68b3edd
Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
2020-06-16 15:54:37 +08:00
Yifan Hong
83c23a0650 Merge "libsnapshot_test: hardcode alignment." 2020-06-15 22:29:34 +00:00
Yifan Hong
b544de9b24 libsnapshot_test: hardcode alignment.
SnapshotUpdateTest uses a relatively small super partition, which
requires a small alignment and 0 alignment offset to work. For the
purpose of this test, hardcode the alignment and offset.
This test isn't about testing liblp or libdm.

Bug: 154355449
Bug: 157437632
Bug: 158718136
Bug: 157633441
Bug: 154646936

Test: atest on devices with alignment of data partition >= 512KiB

Change-Id: I1d0474f028cc824bd4197d0228350395239b3b81
2020-06-15 22:29:24 +00:00
Treehugger Robot
53122b14bc Merge "fuzzy_fastboot: use 'tcp:' prefix to identify fastboot protocol." 2020-06-15 20:05:15 +00:00
Mark Salyzyn
703fb74fb5 modprobe: Use more inclusive language for modprobe and libmodprobe
blacklist is replaced with blocklist.

Test: none
Change-Id: I59f9fde5900b9aee82aca1eab4a6ded3d136063b
2020-06-15 12:51:38 -07:00
Martin Liu
0abd0d6aa5 init.rc: chmod pagetypeinfo to 440 to be captured in BRs
Bug: 158928824
Test: Try BR
Change-Id: I2fa42780b77d86a234ae8b53d7264fbfd6a7906c
2020-06-15 15:24:43 +00:00
Roland Levillain
9287716a1c Merge "Rename native code coverage paths env. variable in libsnapshot's fuzz test." 2020-06-15 10:12:10 +00:00
Nikita Ioffe
b255195375 Merge "Reboot sequence: Unmount active apexes before unmounting /data" 2020-06-13 20:50:21 +00:00
Wenhao Wang
55e8954950 Merge "trusty:storageproxyd: Fix in_cdb.length setting on send_ufs_rpmb_req" 2020-06-13 01:24:50 +00:00
Nikita Ioffe
91a9848775 Reboot sequence: Unmount active apexes before unmounting /data
Having mounted apexes with loop back devices backing files on /data
partition will prevent clean unmount of it. Unmounting them and tearing
down loop devices should minimize the risk of that.

Note that it won't fix the issue completely, as there are a few (~2-3)
processes that keep restarting even after SIGKILL is sent. Which means
that they can still hold references to apexes on /data partition. But
in practice probability of this is quite low.

Test: adb reboot
Test: put tzdata apex in /data/apex/active && adb reboot
Bug: 158152940
Change-Id: I4624567b3d0f304dba4c6e37b77abd89e57411de
2020-06-13 00:13:11 +01:00
Tianjie Xu
8e1b80596f Merge "Update libsnapshot to handle partial update" 2020-06-12 23:04:49 +00:00
Wenhao Wang
469e388e47 trusty:storageproxyd: Fix in_cdb.length setting on send_ufs_rpmb_req
The in_cdb.length (ALLOCATION_LENGTH) must be set in order to send
SECURITY PROTOCOL IN command.

Bug: 143636526
Test: Trusty storage tests
Change-Id: Ie4252e9b19c05825c895ec07f8c9684ae456f6c9
2020-06-12 15:30:08 -07:00
Josh Gao
046cc11982 Merge "adb: avoid crash when authenticating without vendor keys." 2020-06-12 21:41:02 +00:00
Tom Cherry
1a796bca57 logd: add a SerializedLogBuffer suitable for compression
Initial commit for a SerializedLogBuffer.  The intention here is for
the serialized data to be compressed (currently using zlib) to allow
for substantially longer logs in the same memory footprint.

Test: unit tests
Change-Id: I2528e4e1ff1cf3bc91130173a107f371f04d911a
2020-06-12 14:35:30 -07:00
Paul Lawrence
2055364f83 Don't call block checkpoint functions above dm-default-key
Bug: 156225476
Test: Build for f2fs and ext4 device, make sure checkpoints roll back
and commit

Change-Id: I7a772ff712dec9e69df175de840d69d296c65923
2020-06-12 16:15:18 +00:00
Josh Gao
30b0bbd4a2 adb: avoid crash when authenticating without vendor keys.
Bug: http://b/158232136
Test: manual
Change-Id: Ic8211335494a6acb703af5b82f52856223f538bb
2020-06-11 21:31:09 -07:00
Jooyung Han
7cc98e212b Merge "init: start ueventd in the default mount namespace" 2020-06-12 02:06:12 +00:00
Randall Huang
78e0d064c7 Merge "Try to recover corrupted ext4 /data with backup superblock" 2020-06-11 23:46:17 +00:00
Tom Cherry
8d3265539b Merge "logd: add a test for clearing logs with a reader present" 2020-06-11 22:33:21 +00:00
Tom Cherry
8319bb40d0 logd: add a test for clearing logs with a reader present
Test that:
1) Logs are cleared
2) More logs can be added after clear
3) Well behaving blocking readers stay connected and can read new logs
after clear.

Test: this unit test
Change-Id: I8497896f5fb068b1e50ff0dcaab1cf79aebae2bb
2020-06-11 14:13:39 -07:00
Tom Cherry
7a372d168a Merge "logd: simplify Clear() + Prune() logic" 2020-06-11 16:34:20 +00:00
Tom Cherry
a863b1a04b logd: simplify Clear() + Prune() logic
Clear() and Prune() return a boolean indicating whether or not their
operations failed because the log buffer was 'busy'.  This means that
they return false upon success and true upon failure, which is not
intuitive.

This change inverts their return value to simply be true if they were
successful or false otherwise.  It also simplifies the return value of
ChattyLogBuffer::Prune() to true if the requested number of rows have
been pruned or if all rows in the log buffer have been pruned, and
otherwise return false.

Test: logging unit tests
Test: clearing works even under logging pressure
Change-Id: I346bb945496ef62bf8e973298f81c5163f49bc57
2020-06-11 07:59:01 -07:00
Treehugger Robot
6c7b75b421 Merge "Fix a misleading warning message about sysprop overriding" 2020-06-11 14:50:05 +00:00
Jiyong Park
e714cde55d Fix a misleading warning message about sysprop overriding
Regardless of whether a system property is "ro." or not, it can be
overridden by build.prop from the more specific partition. i.e.
foo.bar=true in system/build.prop can be overridden by
foo.bar=false in vendor/build.prop. However, the warning message
was referring the overridden property as "ro." causing confusion
when reading the log. Fix it by not mentioning "ro.".

Bug: 117892318
Test: N/A
Change-Id: I13014522d0c6b507b30c8754e2087fd71cc39971
2020-06-11 19:45:14 +09:00
Jooyung Han
4f23d5a236 init: start ueventd in the default mount namespace
Init starts ueventd in the default mount namespace to support loading
firmware from APEXes.

Bug: 155023652
Test: devices boots
      adb$ nsenter -t (pid of ueventd) -m ls /apex
      => shows all APEXes
Change-Id: Ibb8b33a07eb014752275e3bca4541b8b694dc64b
2020-06-11 15:10:40 +09:00
Randall Huang
72abd7b246 Try to recover corrupted ext4 /data with backup superblock
If the superblock of /data is corrupted, fs_mgr would skip check_fs.
But, e2fsck actually may reference backup superblock to recover
the filesystem. This fix gives fs_mgr second chance to fix corrupted
ext4 /data.

Bug: 156200421
Test: boot with corrupted ext4 superblock

Signed-off-by: Randall Huang <huangrandall@google.com>
Change-Id: Ia39af3340c0e241f62557b7c2cc8b800443342f9
2020-06-11 14:04:47 +08:00
Yo Chiang
3447cdc741 Merge "shell_and_utilities_recovery: Fix required dependencies" 2020-06-11 03:10:01 +00:00
Elliott Hughes
cec2d69a0b Merge "Remove zygote configuration for 32-bit primary, 64-bit secondary." 2020-06-10 23:52:34 +00:00
Elliott Hughes
409bca11de Remove zygote configuration for 32-bit primary, 64-bit secondary.
Bug: https://issuetracker.google.com/138812821
Test: treehugger
Change-Id: I67c59f1956cec7ea46ded6e0a772ac1226e2a7b3
Merged-In: I67c59f1956cec7ea46ded6e0a772ac1226e2a7b3
2020-06-10 22:52:52 +00:00
Marco Ballesio
75d9170454 Merge "libprocessgroup: support for cgroup v2 hierarchy" 2020-06-10 21:36:08 +00:00
Tom Cherry
18b5965e20 Merge "fastboot: don't print anything in Status() if the input is empty" 2020-06-10 19:03:18 +00:00
Tom Cherry
2217c50a4f fastboot: don't print anything in Status() if the input is empty
Status() is called with an empty string to handle `fastboot oem`
commands.  This currently emits a set of spaces and sets
last_start_time such that the epilog can track the time spent in this
command.  Emitting the spaces is problematic however, since it results
in the follow:

 $ fastboot oem device-info
                                                  (bootloader) Verity mode: false
(bootloader) Device unlocked: true
(bootloader) Device critical unlocked: true
(bootloader) Charger screen enabled: true
OKAY [  0.000s]
Finished. Total time: 0.000s

If we skip emitting the spaces, then we get the correct result:

 $ fastboot oem device-info
(bootloader) Verity mode: false
(bootloader) Device unlocked: true
(bootloader) Device critical unlocked: true
(bootloader) Charger screen enabled: true
OKAY [  0.001s]
Finished. Total time: 0.001s

There are no other uses of Status() with an empty string, so this
changes won't impact other commands.

Bug: 158310284
Test: fastboot formats this and other commands correctly.
Change-Id: I6294acefc65a8399160c0944b3fbc2f2ace919ed
2020-06-10 09:29:25 -07:00
Marco Ballesio
f16f9417b0 libprocessgroup: support for cgroup v2 hierarchy
for a first implementation the cgroup v2 freezer controller will be used in a
way similar to cgroup v1, that is a single child group will hold all frozen
processes. Some adjustments are needed for the new structure.

- Add support for cgroup v2 syntax under procfs.
- Separate creation of a directory with ownership/mode changes to allow changes
    after mounting the cgroup kernfs root.
- Allow the creation of sub-groups under a cgroup v2 hierarchy.

Bug: 154548692
Test: manually verified that a proper cgroup v2 hierarchy is created and
accessible

Change-Id: I9af59e8214acaead3f520a94c95e75394c0df948
2020-06-10 09:14:00 -07:00
Treehugger Robot
e4424ff422 Merge "Fix typo in android init language documentation." 2020-06-10 15:08:49 +00:00
Roland Levillain
f596dec176 Rename native code coverage paths env. variable in libsnapshot's fuzz test.
Rename `COVERAGE_PATHS` as `NATIVE_COVERAGE_PATHS`.

Test: n/a
Bug: 158212027
Change-Id: Ifea90488c1350a5f46d3065f2ec786ee93c3aae7
2020-06-10 13:04:53 +01:00
Yo Chiang
dc53f4c266 shell_and_utilities_recovery: Fix required dependencies
TARGET module shell_and_utilities_recovery requires non-existent: unzip.recovery

This should be referring to the "ziptool" module. "unzip" is a symlink
installed by "ziptool".

Bug: 7456955
Test: TH; boot/ramdisk/system/bin/ziptool installed in /boot partition
Change-Id: Ib9edf9c17b4dfdebdb8719fb7b9244fca6133f6d
2020-06-10 07:58:04 +00:00