Commit graph

49906 commits

Author SHA1 Message Date
Tao Bao
e6827e5e87 adb: Allow adb rescue getprop.
Which will dump all the allowed properties, similar to `adb shell
getprop`.

Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Id668224098006d71ee192c8c2bea5d791d2423c1
(cherry picked from commit 599eee1f37)
2019-06-06 09:10:22 -07:00
Anton Hansson
857a861c18 Merge "Close /dev/fuse FD before calling onClosed" into qt-dev
am: b6d9fbddc6

Change-Id: I9cf86c3206cfbbcc2bed84809e5cb7aa454156bd
2019-05-31 09:15:39 -07:00
Anton Hansson
b6d9fbddc6 Merge "Close /dev/fuse FD before calling onClosed" into qt-dev 2019-05-31 15:59:39 +00:00
Anton Hansson
c9e873f274 Close /dev/fuse FD before calling onClosed
This works around a deadlock when a bridge that is about to be closed
is reused for a new call to openFile. The call to open() ends up holding
the vold lock, waiting for appfuse to respond. The appfuse event loop
calls onClosed(), which ends up calling vold.unmountAppFuse(), which
cannot get the lock.

Closing this file descriptor causes any current calls to open() on its
mount path to fail with either ECONNABORTED or ENOTCONN, allowing the
event loop to make progress, call onClosed() and unmount the path.

Note that the failed call to open() will result in a retry, which
will create a new appfuse bridge. This is not ideal but not a new
problem -- the common case here is that that each call to
openProxyFileDescriptor creates a new bridge. This should ideally
be improved.

Bug: 132344997
Test: flick through info of photos with location info attached
Exempt-From-Owner-Approval: verbal approval of approach
Change-Id: I878e5cf86f18c5233f8505f52eb9db076bd72d01
2019-05-31 15:58:45 +00:00
Tom Cherry
6703305986 Merge "init: make fatal reboot target configurable" into qt-dev
am: 4d63d1b7bb

Change-Id: I0b2e40dc8bc23251b71e91abcbecee7c5fc643f0
2019-05-31 08:46:04 -07:00
Tom Cherry
b2b99e2bbd Merge "init: dump stack when aborting" into qt-dev
am: d0ed53e5e7

Change-Id: Iae3268a0672337de5c3e2a7dbc016a59090fa9bc
2019-05-31 08:45:36 -07:00
TreeHugger Robot
4d63d1b7bb Merge "init: make fatal reboot target configurable" into qt-dev 2019-05-31 15:35:15 +00:00
TreeHugger Robot
d0ed53e5e7 Merge "init: dump stack when aborting" into qt-dev 2019-05-31 15:35:13 +00:00
Daichi Hirono
709a189b8e Fix BridgeEpollController to handles EAGAIN correctly
am: ca0d4ffbe3

Change-Id: I47ebbb9f83dfa55474a93ab4d28fba5b20758270
2019-05-31 08:26:40 -07:00
Daichi Hirono
ca0d4ffbe3 Fix BridgeEpollController to handles EAGAIN correctly
When reading/writing proxy FD, if it returns EAGAIN,
BridgeEpollController updates epoll entries to observe specific FD
events. Before updating epoll entries, BridgeEpollController checks if
it really needs to update by comparing |state_| and |last_state_|.
|last_state_| has not been updated correctly so it resulted in wrong
epoll settings and keeps blocking the event loop.

Bug: 134104939
Test: atest libappfuse_test
Change-Id: I1c4a0164c1c016baf24ecfd523476ced981d3b28
2019-05-31 12:51:05 +09:00
Tim Murray
242a92953b Merge "lmkd: use ALOGE for logging kills" into qt-dev
am: cc18faf4d6

Change-Id: I00913e3bd6607a08dd14ba41d4ecf3c056c1cb6d
2019-05-30 15:32:07 -07:00
Tim Murray
cc18faf4d6 Merge "lmkd: use ALOGE for logging kills" into qt-dev 2019-05-30 22:10:56 +00:00
Tim Murray
b62b3ef2ba lmkd: use ALOGE for logging kills
Test: boots, works
Bug: 133761317
Signed-off-by: Tim Murray <timmurray@google.com>
Exempt-From-Owner-Approval: trivial change

Change-Id: I1a4a3741694078eec124f1f560ea68e78754bca6
2019-05-30 22:10:36 +00:00
Tom Cherry
b80149d8bc init: make fatal reboot target configurable
Currently, if init encounters a fatal issues it reboots to fastboot
but this may be not desirable in all cases, especially the case of
critical services crashing.  Therefore this change adds the ability
for vendors to customize the reboot target via the
androidboot.init_fatal_reboot_target= kernel command line.

This applies to all LOG(FATAL) messages as well as fatal signals in
userdebug/eng builds, except for signals before logging is enabled in
first stage init.

Bug: 121006328
Test: device reboots to configurable target with LOG(FATAL)
Test: device reboots to configurable target after a segfault in the
      various stages of init
Test: device reboots to fastboot without a configured target
Change-Id: I16ea9e32e2fee08dece3d33b697d7a08191d607b
Merged-In: I16ea9e32e2fee08dece3d33b697d7a08191d607b
(cherry picked from commit 75e13baf32)
2019-05-30 12:10:51 -07:00
Tom Cherry
1fcd51255a init: dump stack when aborting
Dump init stacks when aborting either due to LOG(FATAL) or in
userdebug/eng builds due to signals, including signals from
sanitizers.

Doesn't work for static first stage init yet, b/133450393 tracks
that.

Also, ensure that LOG(FATAL) in child processes calls abort() in all
stages of init, not just 2nd stage init.

Bug: 131747478
Test: abort init in various ways and see stacks
Test: hang or crash in backtrace handler and see child reboot
Change-Id: Ib53b5d3e7e814244203f875de016ada9900dfce8
Merged-In: Ib53b5d3e7e814244203f875de016ada9900dfce8
(cherry picked from commit 59656fb377)
2019-05-30 12:08:42 -07:00
chihhao.chen
6c78e3ba1b Merge "Fix non-aio USB read issue for fastbootd" into qt-dev
am: 9122289a97

Change-Id: Id416f267f477d04ed5d71f2158ebc35183befa22
2019-05-29 16:35:22 -07:00
TreeHugger Robot
9122289a97 Merge "Fix non-aio USB read issue for fastbootd" into qt-dev 2019-05-29 23:11:55 +00:00
chihhao.chen
5f8b966d96 Fix non-aio USB read issue for fastbootd
non-aio USB read function was stuck in a loop waiting for more data
because data length parameter is always set 64 for fastbootd commands.
It should be a normal case to get less data than expected
since lengths of these commands are usually less than 64.
Add logic to check this and one more parameter to distinguish
fastbootd from general adbd case.

Bug: 133189029
Test: try various fastbootd commands
Change-Id: I6690324840d78f3f1e04235040301520329976db
2019-05-29 12:41:55 -07:00
Ryan Mitchell
fd84f60d45 Fix leak of mapped zip central directories
am: d1531ac4e8

Change-Id: Iacc5d17b17cd05742e78650bde969ccbfa3b09c2
2019-05-29 08:58:44 -07:00
Ryan Mitchell
d1531ac4e8 Fix leak of mapped zip central directories
Memory mapping the central directory of specific APKs caused memory
mappings to build up over time because they were never unmapped
correctly. This is because MappedFile is not calling munmap with the
size of the data after aligning the mmap offset to a page boundary.

Bug: 133463863
Test: install APKs and verify that the entire mapped CD is unmaped
Test: ran aapt2 as daemon and confirmed that mapped CD is unmapped
Change-Id: Icb6cfebe0e8d67160fee34c5e6423d0f05de526b
2019-05-28 23:00:04 +00:00
Narayan Kamath
9e28c5448b rootdir / sdcard : Stop creating /data/media/obb.
am: c6ca823710

Change-Id: I429eacda7dc48b7472814dcecf58e1c7262b37fa
2019-05-24 04:27:10 -07:00
Narayan Kamath
c6ca823710 rootdir / sdcard : Stop creating /data/media/obb.
This directory is no longer used. OBB content is
placed in /data/media/$user/Android.

Test: make
Test: manually verify the path doesn't exist.
Bug: 129167772

Change-Id: I8549826586b9a68c8cfa3fe2e51295363f9b4e11
2019-05-23 15:09:54 +01:00
Bowgo Tsai
56e404c435 Merge "Moving /odm/build.prop to /odm/etc/buid.prop" into qt-dev
am: b36b54cf79

Change-Id: I2b24f88411f9ebd20216371280b2f97fb150e640
2019-05-22 21:35:19 -07:00
Bowgo Tsai
b36b54cf79 Merge "Moving /odm/build.prop to /odm/etc/buid.prop" into qt-dev 2019-05-23 02:13:26 +00:00
Josh Gao
3d40524d33 Merge "adbd: respond to device-to-host control transfers." into qt-dev
am: 8ef22b102c

Change-Id: I198a023196af5815268117bbedfd5f5ba048ca4c
2019-05-22 19:02:56 -07:00
Wei Wang
1cc56a6d51 Merge "Report non-empty system boot reason when bootloader reason is empty" into qt-dev
am: c39fcd42d7

Change-Id: I75baac785e1069806138995582e22ea25d7ff521
2019-05-22 17:58:10 -07:00
Josh Gao
8ef22b102c Merge "adbd: respond to device-to-host control transfers." into qt-dev 2019-05-22 21:06:56 +00:00
Wei Wang
c39fcd42d7 Merge "Report non-empty system boot reason when bootloader reason is empty" into qt-dev 2019-05-22 20:28:58 +00:00
Hridya Valsaraju
4a572d984f fastbootd: reduce USB buffer size to 16K
am: 4472fdb4d0

Change-Id: I86c52fdd909bce5e9ef485f0fda2c4506d5b534f
2019-05-22 10:20:09 -07:00
Wei Wang
699e342b3d Report non-empty system boot reason when bootloader reason is empty
Bug: 133321647
Test: build
Change-Id: Icd3ea4b69ef2ad040926e2b0e121a8f5f1c1b658
2019-05-22 09:46:02 -07:00
Victor Chang
11c0490499 Merge "Allow linking to libicuuc.so and libicui18n.so from executable in /data" into qt-dev
am: 28904625b8

Change-Id: I9e15dfd23cfdab5e16f615b694794b44b9e34937
2019-05-22 09:37:06 -07:00
Hridya Valsaraju
4472fdb4d0 fastbootd: reduce USB buffer size to 16K
Some USB controllers can only support transfers upto 16K.

Bug: 133208811
Test: fastboot flashall
Change-Id: Ic025bdd8e7a6cf2634fc24524fd189e0cc9efbb5
Merged-In: Ic025bdd8e7a6cf2634fc24524fd189e0cc9efbb5
(cherry picked from commit d747dba9c0)
2019-05-22 16:14:22 +00:00
Victor Chang
28904625b8 Merge "Allow linking to libicuuc.so and libicui18n.so from executable in /data" into qt-dev 2019-05-22 15:43:44 +00:00
Bowgo Tsai
3182ea132e Moving /odm/build.prop to /odm/etc/buid.prop
In device root directory, we have the following symlinks:
  - /odm/app -> /vendor/odm/app
  - /odm/bin -> /vendor/odm/bin
  - /odm/etc -> /vendor/odm/etc
  ...

This allows the Generic System Image (GSI) to be used on both devices:
  1) Has a physical odm partition, where those symlink will be hidden
     when /odm is used as the mount point
  2) Has no physical odm partition and fallback to /vendor/odm/.

We can't just have the symlink /odm -> /vendor/odm, because the former
devices won't have /vendor/odm directory, which leads to mount failure
when the mount point /odm is resolved to /vendor/odm.

The existing /vendor/odm/build.prop won't be loaded in the latter
devices, because there is no symlink
    - /odm/build.prop -> /vendor/odm/build.prop.

Note that init blocks reading through direct symlinks (O_NOFOLLOW) so
the above symlink won't work either. This CL moves the odm build.prop
to /odm/etc/build.prop for init to load it (symlinks in earlier
components of the path will still be followed by O_NOFOLLOW).

Bug: 132128501
Test: boot a device and checks /odm/etc/build.prop is loaded
Change-Id: I0733c277baa67c549bb45599abb70aba13fbdbcf
Merged-In: I0733c277baa67c549bb45599abb70aba13fbdbcf
(cherry picked from commit c49655b2a4)
2019-05-22 16:15:44 +08:00
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