Commit Graph

61205 Commits

Author SHA1 Message Date
Tom Cherry 86afb83de8 Merge "logd: add a SerializedLogBuffer suitable for compression" am: 1e412e7d4e am: 395bbc52d2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1326216

Change-Id: I586065388d8215e6f44f50c1bcea3bc37497f594
2020-06-16 17:13:37 +00:00
Tom Cherry 2d66971a8e Merge "fsmgr: fix integer overflow in fs_mgr" am: be42841c61 am: 36d60f5581
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1335698

Change-Id: I983248e8cb987130f4515fcb62052deb74e62a67
2020-06-16 17:13:30 +00:00
Tom Cherry 395bbc52d2 Merge "logd: add a SerializedLogBuffer suitable for compression" am: 1e412e7d4e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1326216

Change-Id: Ia7246ba8aa6192b67f83606d916c0808494c8d6a
2020-06-16 17:01:42 +00:00
Tom Cherry 36d60f5581 Merge "fsmgr: fix integer overflow in fs_mgr" am: be42841c61
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1335698

Change-Id: I00164049a8b8e878855ee13f45b596a3cccb1472
2020-06-16 17:01:34 +00: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
Treehugger Robot 620a7053c5 Merge "init.rc: chmod pagetypeinfo to 440 to be captured in BRs" am: a5032be8e0 am: f9537f222b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1335693

Change-Id: Id9735c5b6677e25f29ea817da30a3df84bee9fed
2020-06-16 08:50:38 +00:00
Treehugger Robot f9537f222b Merge "init.rc: chmod pagetypeinfo to 440 to be captured in BRs" am: a5032be8e0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1335693

Change-Id: I7f64eb4d18f662c4bbe802c2d2950d5c46df67a4
2020-06-16 08:38:42 +00: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 a4aeaafedd [automerger skipped] libsnapshot_test: hardcode alignment. am: 755eb6b606 -s ours
am skip reason: Change-Id I1d0474f028cc824bd4197d0228350395239b3b81 with SHA-1 b544de9b24 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11870537

Change-Id: I2a3520ee4a12cc1721fe398a8b70e3a21c718328
2020-06-15 23:50:28 +00:00
Yifan Hong d9cf12c089 Merge "libsnapshot_test: hardcode alignment." am: 83c23a0650 am: f32197f28a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1330937

Change-Id: Id0d5fda3a536c8f826e815f1d00ffc0e09ddf411
2020-06-15 22:56:55 +00:00
Yifan Hong f32197f28a Merge "libsnapshot_test: hardcode alignment." am: 83c23a0650
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1330937

Change-Id: I497dcb257ca4e310ed9e52f8a4443a5f08ae7189
2020-06-15 22:38:40 +00: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
Yifan Hong 755eb6b606 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.

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

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

Change-Id: I1d0474f028cc824bd4197d0228350395239b3b81
(cherry picked from commit 31739669e91c7a3afc5bee23e43bc45fb4154667)
Merged-In: I1d0474f028cc824bd4197d0228350395239b3b81
2020-06-15 14:00:12 -07:00
Treehugger Robot 055be4afa2 Merge "fuzzy_fastboot: use 'tcp:' prefix to identify fastboot protocol." am: 53122b14bc am: 35fd48b54a
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1323282

Change-Id: If025f82d43c8e29a2862f5a2aef217070a914296
2020-06-15 20:30:56 +00:00
Treehugger Robot 35fd48b54a Merge "fuzzy_fastboot: use 'tcp:' prefix to identify fastboot protocol." am: 53122b14bc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1323282

Change-Id: I73dca84b1908e1c2c0b45e53a75d4559e3dace51
2020-06-15 20:13:32 +00:00
Treehugger Robot 53122b14bc Merge "fuzzy_fastboot: use 'tcp:' prefix to identify fastboot protocol." 2020-06-15 20:05:15 +00: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 5df4fa1e97 Merge "Rename native code coverage paths env. variable in libsnapshot's fuzz test." am: 9287716a1c am: 41ef412238
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1329093

Change-Id: Ibe517b4f639eadf112106f3228f4979a24d96665
2020-06-15 10:37:09 +00:00
Roland Levillain 41ef412238 Merge "Rename native code coverage paths env. variable in libsnapshot's fuzz test." am: 9287716a1c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1329093

Change-Id: I89afbdcc5ad57dfef3b7ff81187a4084444a6535
2020-06-15 10:18:46 +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 64697dcd89 Merge "Reboot sequence: Unmount active apexes before unmounting /data" am: b255195375 am: d60f0708c9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1327913

Change-Id: Ie64a60f5a104ad22326e2d632b5cf30b2f489f42
2020-06-13 21:14:03 +00:00
Nikita Ioffe d60f0708c9 Merge "Reboot sequence: Unmount active apexes before unmounting /data" am: b255195375
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1327913

Change-Id: I9c3f634a7ae890c21bc83c1de1d9c7a1ff38065f
2020-06-13 21:00:30 +00:00
Nikita Ioffe b255195375 Merge "Reboot sequence: Unmount active apexes before unmounting /data" 2020-06-13 20:50:21 +00:00
Wenhao Wang 8124ee9930 Merge "trusty:storageproxyd: Fix in_cdb.length setting on send_ufs_rpmb_req" am: 55e8954950 am: f20e589c00
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1334266

Change-Id: I1e3b4fe083d2670b1f31f331e540ee61cd64f2a1
2020-06-13 01:57:12 +00:00
Wenhao Wang f20e589c00 Merge "trusty:storageproxyd: Fix in_cdb.length setting on send_ufs_rpmb_req" am: 55e8954950
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1334266

Change-Id: I931778780adf52ab9dcb756d2633451ed6369eb8
2020-06-13 01:40:47 +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
Tianjie Xu 3423d5edc7 Merge "Update libsnapshot to handle partial update" am: 8e1b80596f am: dd513953ac
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1326217

Change-Id: Id7f0cd2bbe8c1cec431d369477f0fb1099a9c8cc
2020-06-12 23:33:39 +00:00
Tianjie Xu dd513953ac Merge "Update libsnapshot to handle partial update" am: 8e1b80596f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1326217

Change-Id: I5d6658413141bc151d136293f5e37f8eefb4fecc
2020-06-12 23:14:05 +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 b2d6d25eeb Merge "adb: avoid crash when authenticating without vendor keys." am: 046cc11982 am: dada5fd17e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1331888

Change-Id: I917a3a1d8f51fa883565c4ec69fb43fd2699edc6
2020-06-12 21:58:31 +00:00
Josh Gao dada5fd17e Merge "adb: avoid crash when authenticating without vendor keys." am: 046cc11982
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1331888

Change-Id: I8d634811a847261bd186a9e66ede6b3ebc0d0f98
2020-06-12 21:51:30 +00: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
Randall Huang 9bbce096b4 Try to recover corrupted ext4 /data with backup superblock am: 4e864e1216
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11835152

Change-Id: I753843814912e7bf610e277621778170051edbb4
2020-06-12 17:32:47 +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 971add2022 Merge "init: start ueventd in the default mount namespace" am: 7cc98e212b am: 9b07c52de0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1325695

Change-Id: I8e29d81747b871f3e92c32c43d74f4fc6bdf8b85
2020-06-12 02:26:52 +00:00
Jooyung Han 9b07c52de0 Merge "init: start ueventd in the default mount namespace" am: 7cc98e212b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1325695

Change-Id: Ib4ed39d69aef7bf25dbdb0cc161d72532a5b2d4c
2020-06-12 02:16:06 +00:00
Randall Huang 4e864e1216 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: Ieb89e7274d772962fe37927dcd62567dd5aa4657
(cherry picked from commit 72abd7b246)
2020-06-12 02:07:35 +00:00
Jooyung Han 7cc98e212b Merge "init: start ueventd in the default mount namespace" 2020-06-12 02:06:12 +00:00
Randall Huang f7228a8565 Merge "Try to recover corrupted ext4 /data with backup superblock" am: 78e0d064c7 am: 86ee5c700f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1318221

Change-Id: Ieb89e7274d772962fe37927dcd62567dd5aa4657
2020-06-12 00:07:53 +00:00
Randall Huang 86ee5c700f Merge "Try to recover corrupted ext4 /data with backup superblock" am: 78e0d064c7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1318221

Change-Id: I1199d71921e33f93088b1adea7609012923dd706
2020-06-11 23:54:56 +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 00db963bb9 Merge "logd: add a test for clearing logs with a reader present" am: 8d3265539b am: 00636fb0d1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1331017

Change-Id: I6c06e5cbdeacbaafe009d837975095f575924db1
2020-06-11 22:50:32 +00:00
Tom Cherry 00636fb0d1 Merge "logd: add a test for clearing logs with a reader present" am: 8d3265539b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1331017

Change-Id: I9cb52c5da6c249f959f17a2e9635fb78b69e3d0d
2020-06-11 22:43:39 +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