Commit Graph

50022 Commits

Author SHA1 Message Date
Josh Gao af086e9a95 adbd: respond to device-to-host control transfers.
Failing to write to the endpoint results in subsequent reads on ep0 to
fail with EL2HLT, so do an empty write to fulfill the transfer.

Bug: http://b/131867920
Test: manually tested with modified auto client
Change-Id: If2eec162ca4b31a9974c7bd5802be51cee9e2708
2019-05-21 16:39:51 -07:00
Suren Baghdasaryan ed81cc26aa Merge "libprocessgroup: add flags to indicate when a controller failed to mount" into qt-dev
am: 9b77c0ba32

Change-Id: Icd2b6b66b6de3a50c01285143deeb1db3eab2738
2019-05-21 12:50:24 -07:00
Suren Baghdasaryan 9b77c0ba32 Merge "libprocessgroup: add flags to indicate when a controller failed to mount" into qt-dev 2019-05-21 16:53:52 +00:00
Hridya Valsaraju 65c0209a70 Merge "Get max-download-size from device during fastbootd for flashall/update" into qt-dev
am: 2a19765eb5

Change-Id: I70b4b5f80f13ffe541b752655a2508a66541ad19
2019-05-20 22:41:01 -07:00
TreeHugger Robot 2a19765eb5 Merge "Get max-download-size from device during fastbootd for flashall/update" into qt-dev 2019-05-21 04:54:08 +00:00
Josh Gao b28857eee6 Merge "adbd: reduce queue depths." into qt-dev
am: 7eeed22871

Change-Id: I83c6590a8c3693200bb37a77edd8782fb77d414c
2019-05-20 17:43:30 -07:00
Josh Gao bec7df797b Merge "adbd: avoid starting multiple worker threads." into qt-dev
am: 5b882637e1

Change-Id: I073e5b7c608e153286a4f146b376a4b1dc64777a
2019-05-20 17:41:55 -07:00
Josh Gao cea1c6248b Merge "adbd: read, print, and ignore USB control transfers." into qt-dev
am: 6031286936

Change-Id: Iff482249f9442a851e2681869babc2bcb081385b
2019-05-20 17:29:18 -07:00
TreeHugger Robot 7eeed22871 Merge "adbd: reduce queue depths." into qt-dev 2019-05-21 00:05:34 +00:00
TreeHugger Robot 5b882637e1 Merge "adbd: avoid starting multiple worker threads." into qt-dev 2019-05-21 00:04:15 +00:00
Hridya Valsaraju f929aaa7c0 Get max-download-size from device during fastbootd for flashall/update
Currently, during a 'fastboot flashall/fastboot update', the 'getvar
max-download-size' command is issued once to the device when it is in
bootloader mode and the same value is used even after the device boots
into fastbootd. If the max-download-size returned by bootloader is
greater than the max-download-size in fastbootd, this could break flash
as large images are broken down into chunks before downloading by using
the max-download-size variable. This will cause fastbootd to return
an error since it checks whether the buffer being downloaded has a size
greater than the max-download-size limit.

Test: fastboot flashall
Bug: 132917902

Change-Id: Ife7c1ec0583d80d4a31ecf01f1fc14a8365afe0d
Merged-In: Ife7c1ec0583d80d4a31ecf01f1fc14a8365afe0d
(cherry picked from commit 83d856e4c5)
2019-05-20 23:58:45 +00:00
TreeHugger Robot 6031286936 Merge "adbd: read, print, and ignore USB control transfers." into qt-dev 2019-05-20 21:37:24 +00:00
Victor Chang 32190f45e0 Allow linking to libicuuc.so and libicui18n.so from executable in /data
Executable in /data/ runs in default linker namespace, not
classloader namespace.
In Q, we moved libicuuc.so and libicui18n into the runtime
namespace, and allow linking from runtime namespace and classloader
namespace.

This change further allows linking from default namespace, and tries
to fix the regression temporarily.

Bug: 130788466
Test: The app issue is fixed after this CL
Merged-In: Ifae52b554124514e433cfe78875643a7450fbabd
Change-Id: Ifae52b554124514e433cfe78875643a7450fbabd
(cherry picked from commit 0c7edece94)
2019-05-20 11:59:51 +01:00
Josh Gao 12807c7012 adbd: read, print, and ignore USB control transfers.
It seems like we're blowing up when receiving a control transfer that's
intended for Android Auto, because we're not expecting to get the data
for the control transfer in a subsequent read.

Bug: http://b/131867920
Test: none
Change-Id: Icfd642e6dfc02d2ccbdd60c39f89e534298c944d
2019-05-17 18:34:23 -07:00
Suren Baghdasaryan fd285d2b70 libprocessgroup: add flags to indicate when a controller failed to mount
Controllers listed in cgroups.json file might fail to mount if kernel is
not configured to support them. We need a way to indicate whether a
controller was successfully mounted and is usable to avoid logging errors
and warnings when a controller that failed to mount is being used. Add
flags bitmask to cgrouprc controller descriptor and use a bit to indicate
that controller is successfully mounted. Modify cpusets_enabled() and
schedboost_enabled() functions to use this bit and report the actual
availability of the controller.

Bug: 124080437
Test: libcutils_test with cpuset and schedtune controllers disabled
Change-Id: I770cc39fe50465146e3205aacf77dc3c56923c5d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-05-17 16:18:29 -07:00
Evgenii Stepanov 5c1b6041a4 Merge "Initialize all fields of struct iocb." into qt-dev
am: 982259add1

Change-Id: I957043d53b66060d36af3af8a7cad5de7d289194
2019-05-16 17:25:50 -07:00
TreeHugger Robot 982259add1 Merge "Initialize all fields of struct iocb." into qt-dev 2019-05-16 23:27:38 +00:00
Evgenii Stepanov 9da358d6d3 Initialize all fields of struct iocb.
Kernel does not accept non-zero value of iocb->aio_reserved2.

Bug: 132803232
Test: initialize malloc() memory to non-zero pattern and see what breaks

Change-Id: I65a7e89e3a2c1ba79df1dc2d011d6c76c41afb81
(cherry picked from commit fe7eca7b8f)
2019-05-16 12:55:41 -07:00
Alistair Strachan 98080665f0 Merge "Add asan.permitted.paths for the media namespace" into qt-dev
am: 9924f7ee2d

Change-Id: Ic7d3c4b52979e451a63104317c7672f54c904266
2019-05-16 07:53:55 -07:00
Alistair Strachan 9924f7ee2d Merge "Add asan.permitted.paths for the media namespace" into qt-dev 2019-05-16 14:45:58 +00:00
Martijn Coenen 63bbb9ca5f Merge "class_start_post_data also starts disabled services." into qt-dev
am: 5ff7c4b22d

Change-Id: I26a25afb6e4dc6f9bcd5daaf6392abf0f3a4367f
2019-05-16 00:43:38 -07:00
Martijn Coenen 5ff7c4b22d Merge "class_start_post_data also starts disabled services." into qt-dev 2019-05-16 07:29:35 +00:00
Hridya Valsaraju 06a8045674 Merge "Allow CreateResizeDeleteLP test case to run on non-A/B devices" into qt-dev
am: 2c4803838e

Change-Id: Ie24284987a4423a67e2e26bd8095e96a428761e3
2019-05-15 15:37:02 -07:00
TreeHugger Robot 2c4803838e Merge "Allow CreateResizeDeleteLP test case to run on non-A/B devices" into qt-dev 2019-05-15 22:25:03 +00:00
Martijn Coenen ebce675b17 class_start_post_data also starts disabled services.
This keyword was introduced to support restarting services on devices
using APEX and FDE. The current implementation is not a restart, but
rather a 'reset' followed by a 'start', because the real /data must be
mounted in-between those two actions. But we effectively want this to be
a restart, which means that we also want to start 'disabled' services
that were running at the time we called 'class_reset_post_data'.

To implement this, keep track of whether a service was running when its
class was reset at post-data, and start all those services.

Bug: 132592548
Test: manual testing on FDE Taimen
Change-Id: I1e81e2c8e0ab2782150073d74e50e4cd734af7b9
2019-05-15 22:23:41 +02:00
Hridya Valsaraju fbaffb5deb Allow CreateResizeDeleteLP test case to run on non-A/B devices
Test: fuzzy_fastboot --gtest_filter=*Logical*
Bug: 117220134

Change-Id: Ic7c2b246b7c5646d3589f8f57eceb9ba5feeef2b
Merged-In: Ic7c2b246b7c5646d3589f8f57eceb9ba5feeef2b
(cherry picked from commit f81bd17179)
2019-05-15 09:29:34 -07:00
Jiyong Park 78e6b181ac Add asan.permitted.paths for the media namespace
Permitted paths were empty for ASAN builds with the media namespace.

Bug: 131625115
Test: no dlopen failure on libflacextractor.so in aosp_cf_x86_pasan
Change-Id: I90050fc54820ba68d64931412572f3b0954e6616
2019-05-15 12:41:01 +09:00
TreeHugger Robot 83e9f6bd68 Merge "fs_mgr: overlayfs: ReadFstabFromFile touches errno" into qt-dev 2019-05-14 00:25:22 +00:00
TreeHugger Robot 82ebfca5cd Merge "adbd: don't abort on EOF on functionfs control fd." into qt-dev 2019-05-13 22:21:59 +00:00
Josh Gao 1f7ae9d4e3 adbd: don't abort on EOF on functionfs control fd.
Also, improve the logging in the cases where we do abort.

Bug: http://b/131867920
Test: treehugger
Change-Id: If8ec9f4614ce146e6dbd21cc77587ea81658199b
(cherry picked from commit 2916e148d9)
2019-05-13 11:42:29 -07:00
Mark Salyzyn 8471f92a20 fs_mgr: overlayfs: ReadFstabFromFile touches errno
(cherry picked from commit 98a0128e44)

Regression from commit 77c28476f1
("Remove the mount points defined in skip_mount.cfg from
ReadDefaultFstab()") resulted in ReadFstabFromFile to report
errno ENOENT even upon success, preventing clear error propagation
for real failures (ReadFstabFromFile would _always_ report ENOENT).

The bad error propagation resulted in an adb remount failure.

Added immunization against future adjustments that may also
result in a similar regression in adb remount behaviors.

Test: adb-remount-test.sh
Bug: 132594161
Bug: 128961335
Change-Id: Icf5d48bbfc6d938d4b9657ca8004a6a6ddaab5a6
2019-05-13 11:03:10 -07:00
Martijn Coenen 122bf2aedf Merge "Fix bug that would prevent us from reserving right amount of space." into qt-dev 2019-05-13 06:49:30 +00:00
David Anderson 8a04457218 Merge "Add a liblp test that we can parse the device's super partition." into qt-dev 2019-05-11 00:20:02 +00:00
Michael Groover b9c555e2cf Merge "Notify the framework when an adb key is authorized" into qt-dev 2019-05-10 22:54:55 +00:00
David Anderson 9a8b9e0163 Add a liblp test that we can parse the device's super partition.
Bug: 132112489
Test: liblp_test gtest
Change-Id: I1c0950dc30f42cd232e0616191d1365cdfc6512d
Merged-In: I1c0950dc30f42cd232e0616191d1365cdfc6512d
2019-05-10 12:16:19 -07:00
Martijn Coenen b3462c123c Fix bug that would prevent us from reserving right amount of space.
Bug: 132403230
Test: inspect dmesg output:
[   10.762678] init: [libfs_mgr]Setting reserved block count on
/dev/block/dm-2 to 32768
[   10.782652] tune2fs: Setting reserved blocks gid to 1065\x0a
[   10.782655] tune2fs: Setting reserved blocks count to 32768\x0a

Change-Id: Id366d478bdd8a748bb1ba97d08a3b52e3cdd1efb
2019-05-10 10:39:54 +02:00
TreeHugger Robot 377a244710 Merge "crash_dump: populate uid field." into qt-dev 2019-05-10 02:51:02 +00:00
Josh Gao b80fe7a48d crash_dump: populate uid field.
Bug: http://b/132359035
Test: manual
Change-Id: I99d8446024fc2d9395132dea45f03317976a9b62
(cherry picked from commit 5df504c5f8)
2019-05-09 16:48:01 -07:00
Maciej Zenczykowski 6a2b82e654 Merge "Make the SocketListener control pipe O_CLOEXEC." into qt-dev 2019-05-09 23:45:07 +00:00
Michael Groover 7eeda6ba03 Notify the framework when an adb key is authorized
Bug: 124076524
Test: atest AdbDebuggingManagerTest
Change-Id: If73b81ca73ba4d64763cf49c1bbe42de81fa1cb6
2019-05-09 16:05:40 -07:00
TreeHugger Robot 482ea4a611 Merge "fs_mgr_remount: fix a typo" into qt-dev 2019-05-09 14:43:18 +00:00
TreeHugger Robot 9d97b88efe Merge "Apply initial settings for blkio cgroup" into qt-dev 2019-05-09 09:40:13 +00:00
Bowgo Tsai d244a751fd fs_mgr_remount: fix a typo
Replacing "ro.boot.vbmeta.devices_state" with
"ro.boot.vbmeta.device_state" to check if the device is locked.

Bug: 132224452
Test: tree hugger
Change-Id: If4f312730cc82ad5a5d5104a7aca8b9691cf6600
(cherry picked from commit 2badf73b99)
2019-05-09 17:20:13 +08:00
Tao Bao c0cf2d9eec [automerger skipped] DO NOT MERGE Start update_verifier early in late-fs.
am: 79cfc7d5a8 -s ours
am skip reason: subject contains skip directive

Change-Id: If1e9e67406324b70cb09fbaf4cb60c9bbcef1ad9
2019-05-08 21:53:43 -07:00
Lorenzo Colitti f38e182fbf Make the SocketListener control pipe O_CLOEXEC.
Children of processes that use SocketListener should not be able
to stop the SocketListener.

Test: builds, boots
Test: atest libsysutils_tests
Test: atest --test-mapping system/netd
Bug: 131268436
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I64898d9966f62004468b8e8a43b59be4a81a8cc4
Merged-In: I64898d9966f62004468b8e8a43b59be4a81a8cc4
(cherry picked from commit dae0195380)
2019-05-08 21:02:57 -07:00
Rick Yiu c7bf1a01fd Apply initial settings for blkio cgroup
Bug: 117857342
Test: values are applied
Change-Id: Id28d9619fc2fd2287fe656b8032025184ae7f631
(cherry picked from commit a8aaf198d5)
Merged-In: Id28d9619fc2fd2287fe656b8032025184ae7f631
2019-05-09 03:14:11 +00:00
Vic Yang b562e68503 Static link libjsoncpp in libprocessgroup
The majority of libjsoncpp use is due to libprocessgroup.  Static
linking reduces relocations required at runtime as well as compacts the
pages dirtied by relocations.  On a 32-bit system, where this matters
the most, this reduces 8KB of dirty pages per libprocessgroup load.
Overall, the dirty page reduction on 32-bit cuttlefish is ~500KB.

Bug: 132275636
Test: Boot on cuttlefish.  Calculate total amount of dirty memory used
      for libprocessgroup and libjsoncpp.
Change-Id: I1135bb45a3764f96a4a3a47c98fbcdee3913c988
2019-05-08 13:04:11 -07:00
Iris Chang 9d7d26a5cf Support booting a chained boot-debug.img
boot-debug.img is introduced to allow 'adb root' if the device is
unlocked, and it cannot be release signed. If /boot partition is chained
in AVB signing and boot-debug.img is used, avb_slot_verify() in
userspace will return AVB_SLOT_VERIFY_RESULT_ERROR_PUBLIC_KEY_REJECTED
and fs_mgr will refuse to boot. This CL treats the public key rejection
as non-fatal for chained vbmeta to continue booting, if the device is
unlocked.

Bug: 129508966
Test: can root with user load which /boot chained in AVB signing
Change-Id: Idfa8caffbb96f33702b1749afd2e2a59616ddba7
Merged-In: Idfa8caffbb96f33702b1749afd2e2a59616ddba7
(cherry picked from commit 705fd7f52c)
2019-05-08 08:04:33 +08:00
Tao Bao 79cfc7d5a8 DO NOT MERGE Start update_verifier early in late-fs.
We used to start update_verifier after mounting userdata (post-fs-data),
as part of zygote-start. This leads to issues in practice for security
updates, where an A/B device falls back into the old slot (for any
reason, which unrelates to this change) but failing to boot due to
upgraded key blob. It essentially breaks the fallback capability offered
by A/B OTA.

This CL mitigates the issue by starting update_verifier early, before
mounting userdata. This avoids the device from falling back to the old
slot with an already-upgraded key blob. update_verifier loses the
opportunity of verifying _all_ the updated blocks based on the info
that's stored in userdata.  Instead it will only trigger the minimal
read to finish the work of marking a successful boot. This is a
trade-off in P to avoid putting the device in a bad state after
fallback, which will be improved in Q by better handling the fallback
path in vold.

Bug: 131176531
Test: Flash and boot crosshatch. Check the start of update_verifier and
      it marks a successful boot.
Change-Id: I3f4c4333ff38772a9a93c9d027d497db11de1d63
2019-05-07 12:50:58 -07:00
Christopher Ferris f40a740034 Merge "Ignore memory from elf on /memfd:" into qt-dev 2019-05-04 05:05:55 +00:00