Commit Graph

47631 Commits

Author SHA1 Message Date
Josh Gao bde8c848d8 adbd: compile a static version.
Test: mma
Change-Id: I785de074f9b5cc63d1804420b734c4b07081a716
2019-05-01 18:25:52 -07:00
Josh Gao 910ce0ff08 adbd: avoid starting multiple worker threads.
A previous patch intended to make receiving multiple FUNCTIONFS_ENABLEs
non-fatal, but failed to do so because we would try to spawn another
worker thread and hit a different assertion.

Bug: http://b/130638368
Test: echo mem | adb shell "su 0 sh -c 'cat > /sys/power/state'"
Change-Id: I53456112244d8b4f7d26df6ec6961389fca70498
2019-05-01 17:27:27 -07:00
Josh Gao b5d1d19269 adbd: move posix_fadvise after open.
Test: treehugger
Change-Id: I531e452eda46d7df3106fd59192e9936e64876b1
2019-05-01 13:40:01 -07:00
Martin Stjernholm c57ed29dd5 Reland: Fix libnativeloader to correctly link to the platform namespace.
This relands http://r.android.com/951440:

This affected binaries in the Runtime APEX, where the platform namespace is
"platform" rather than "default".

Also extend ANDROID_ADDITIONAL_PUBLIC_LIBRARIES to create links to both to
platform and runtime namespaces, so that it can be used to open up access to
internal libraries in the Runtime APEX as well, which is used by ART gtests
and run tests.

Also update some comments in the ld.config*.txt files to accurately explain
why some namespaces need to be visible, and some other minor changes for
consistency. There are no semantically significant changes in those files.

Test: Flash and boot
Test: Run an ART run test with the internal libarttest.so library
Test: lunch aosp_cf_x86_phone-eng;
  atest android.compilation.cts.AdbRootDependentCompilationTest#testCompile_curProfile \
    com.android.cts.dexmetadata.InstallDexMetadataHostTest#testProfileSnapshotAfterInstall \
    installd_dexopt_test
Bug: 130293232
Bug: 121117762
Change-Id: I3d9f2102a03e83843e15bc78b5ad347220c52769
2019-05-01 16:46:06 +01:00
Martin Stjernholm a36eda0e18 Merge "Add linker entries for the new libdexfiled_external.so."
am: cc30f4d7dd

Change-Id: I151eef44bf47c6d6fd34dfe68697e485ebb9aaa0
2019-05-01 07:38:13 -07:00
Martin Stjernholm cc30f4d7dd Merge "Add linker entries for the new libdexfiled_external.so." 2019-05-01 14:30:35 +00:00
Zimuzo Ezeozue bceb5a6bfb Merge "Attempt native rollback for frequent crashes before boot completed"
am: e9252285ef

Change-Id: Ia7694dbf47cf4792b9adde1158a450900e34aa62
2019-04-30 16:11:46 -07:00
Zimuzo Ezeozue e9252285ef Merge "Attempt native rollback for frequent crashes before boot completed" 2019-04-30 22:57:39 +00:00
Martin Stjernholm 8a50dad467 Add linker entries for the new libdexfiled_external.so.
Follow up to http://r.android.com/943476. This library is only available in
debug builds of the Runtime APEX.

Test: Flash and boot with eng build
Change-Id: I260f9b838f44ba3f8976c117d9e42fc456239e88
2019-04-30 16:11:30 +01:00
Zimuzo 88de80fc53 Attempt native rollback for frequent crashes before boot completed
Before, if updatable processes crash 4 times in 4mins, a native
rollback will be attempted. This behavior does not detect
system_server early boot deadlocks because the system server requires
at least a min to detect a deadlock, and crash itself. The crashes
don't happen frequently enough for init to detect.

After, this cl, the old behavior exists and additionally, init detects
*any* 4 crashes of updatable processes before boot completed,
regardless of if they happen within 4mins or not.

Test: Manually tested by adding artificial sleep in system_server so
deadlock is triggered before boot. system_server crashes 4 times in
over 4mins and the ro.init.updatable_crashing prop is set to 1.
Bug: 129597207

Change-Id: Ie6fb5693ff4be105bcbe139c22850fb076e40260
2019-04-30 11:19:19 +00:00
Jim Blackler 1376ac38b2 Merge "Allow memory metrics on devices that use kernel LMK"
am: 446014ecf9

Change-Id: I9b24267ab63bd4fb58fb36de50561a9c2bf47939
2019-04-30 03:24:06 -07:00
Jim Blackler 446014ecf9 Merge "Allow memory metrics on devices that use kernel LMK" 2019-04-30 10:05:42 +00:00
Martin Stjernholm affe1f2617 Merge "Revert "Fix libnativeloader to correctly link to the platform namespace.""
am: 68cf801ad9

Change-Id: I4787e48d5abe6a0a282ebe0b65705853b67e4849
2019-04-29 17:35:51 -07:00
Treehugger Robot 68cf801ad9 Merge "Revert "Fix libnativeloader to correctly link to the platform namespace."" 2019-04-30 00:13:22 +00:00
Tom Cherry 047e9407f3 Merge "liblog: display valid utf8 characters with 'printable' log format"
am: 6682d3bbba

Change-Id: I5051f7579274992ec59d4225ee5a537934345f04
2019-04-29 16:33:44 -07:00
Tom Cherry 6682d3bbba Merge "liblog: display valid utf8 characters with 'printable' log format" 2019-04-29 23:17:12 +00:00
Josh Gao 6848befe69 Merge "adb: restore generation of public key in `adb keygen`."
am: fe6cc3e2d3

Change-Id: Ifaa0d70091189374c2294d021ede28d8786b5710
2019-04-29 15:53:43 -07:00
Treehugger Robot fe6cc3e2d3 Merge "adb: restore generation of public key in `adb keygen`." 2019-04-29 22:31:17 +00:00
Martin Stjernholm b9259a9cbe Revert "Fix libnativeloader to correctly link to the platform namespace."
This reverts commit 4ca0ca67bf.

Reason for revert: Breaks android.compilation.cts.AdbRootDependentCompilationTest#testCompile_curProfile and others: http://g/art-team/R2nEDA1Ka_s

Change-Id: Ia6285648133d21e61040efafc73cac97d702a7c4
2019-04-29 20:57:16 +00:00
Josh Gao 032989a2ba adb: restore generation of public key in `adb keygen`.
We don't need the public key to be generated at ~/.android/adbkey.pub,
but it's still useful to be able to generate the public key for use with
ADB_VENDOR_KEYS.

Bug: http://b/119634232
Test: manual
Change-Id: Iecd6ff1bba4af4ba142456034f3faf52bb9e017d
2019-04-29 12:36:32 -07:00
Tianjie Xu 979f05c621 Merge "Support adb rescue wipe command"
am: 56311071fe

Change-Id: I19eea45c09b8a5bc1064701af9b5f4d6bb8494a4
2019-04-29 11:00:14 -07:00
Tianjie Xu 56311071fe Merge "Support adb rescue wipe command" 2019-04-29 17:47:20 +00:00
Andreas Gampe 7b3377cdc6 Merge "Nativeloader: Restrict anonymous namespace creation"
am: d21a090f79

Change-Id: Ic080bbb6bb6f0a8ecadd31ee3d29b89546475782
2019-04-29 09:26:07 -07:00
Tom Cherry 9158984894 liblog: display valid utf8 characters with 'printable' log format
This started as a change to use mbrtowc() instead of
utf8_character_length() as mbrtowc() does everything that
utf8_character_length() intends to do, but is a libc function. The
change was further intended to add unit tests to ensure that these
functions operate as intended.

It turns out that utf8_character_length() returned an error for the
utf8 characters that I tested, so this also has the side effect of
allowing valid utf8 characters to be printed in the 'printable' log
format, which was the original intention.

Also, print the binary data as hex instead of octal, since it is a
more suitable choice.

Test: new unit tests, existing unit tests, logcat -v printable
Change-Id: I4cc95aee81519411ef47892ca74eb31117c972d2
2019-04-29 09:14:37 -07:00
Treehugger Robot d21a090f79 Merge "Nativeloader: Restrict anonymous namespace creation" 2019-04-29 16:08:15 +00:00
Martin Stjernholm 487b5784b6 Merge "Fix libnativeloader to correctly link to the platform namespace."
am: bce25d2363

Change-Id: Ic5178afa9241f697d04a8ea93534620582b6d291
2019-04-29 08:21:46 -07:00
Treehugger Robot bce25d2363 Merge "Fix libnativeloader to correctly link to the platform namespace." 2019-04-29 15:08:52 +00:00
Martin Stjernholm 4ca0ca67bf Fix libnativeloader to correctly link to the platform namespace.
This affected binaries in the Runtime APEX, where the platform namespace is
"platform" rather than "default".

Also extend ANDROID_ADDITIONAL_PUBLIC_LIBRARIES to create links to both to
platform and runtime namespaces, so that it can be used to open up access to
internal libraries in the Runtime APEX as well, which is used by ART gtests
and run tests.

Also update some comments in the ld.config*.txt files to accurately explain
why some namespaces need to be visible, and some other minor changes for
consistency. There are no semantically significant changes in those files.

Test: Flash and boot
Test: Run an ART run test with the internal libarttest.so library
Bug: 130293232
Bug: 121117762
Change-Id: I7ebaf5370dd0f533b1bb5f0e67e7c3c1df48e512
2019-04-29 13:09:08 +01:00
Jim Blackler 3947c938a7 Allow memory metrics on devices that use kernel LMK
Bug: 130017100
Test: Tested manually
Change-Id: I37f6edb71decc1260bd521595842508926fa86aa
2019-04-29 11:02:51 +00:00
xunchang c2265c5343 Support adb rescue wipe command
Support `adb rescue wipe` command on the host side. This command runs
under the rescue mode and wipes data (and cache/metadata).

Bug: 131037235
Test: run adb rescue wipe

Change-Id: Ib3a3f2d564cc19d0446540d616cc21489ba558c2
2019-04-26 10:37:13 -07:00
Andreas Gampe b9df7d936c Nativeloader: Restrict anonymous namespace creation
Create the anonymous namespace only from a non-empty library path.

This is a better heuristic than the current "first-come" one. It
allows creating classloaders that are not directly related to an
app's "main" classloader, that is, do not have any library path.
This is the case, for example, for shared libraries, including
preloaded ones.

Longer-term, the anonymous namespace creation should be made
explicit, so that the framework can have full control.

Bug: 130623656
Test: m
Test: manual
Change-Id: I8251363b372e365d10ae09d23df93d76388ac7f9
2019-04-26 08:55:53 -07:00
Martijn Coenen 70788f93ba Support for stopping/starting post-data-mount class subsets.
On devices that use FDE and APEX at the same time, we need to bring up a
minimal framework to be able to mount the /data partition. During this
period, a tmpfs /data filesystem is created, which doesn't contain any
of the updated APEXEs. As a consequence, all those processes will be
using the APEXes from the /system partition.

This is obviously not desired, as APEXes in /system may be old and/or
contain security issues. Additionally, it would create a difference
between FBE and FDE devices at runtime.

Ideally, we restart all processes that have started after we created the
tmpfs /data. We can't (re)start based on class names alone, because some
classes (eg 'hal') contain services that are required to start apexd
itself and that shouldn't be killed (eg the graphics HAL).

To address this, keep track of which processes are started after /data
is mounted, with a new 'mark_post_data' keyword. Additionally, create
'class_reset_post_data', which resets all services in the class that
were created after the initial /data mount, and 'class_start_post_data',
which starts all services in the class that were started after /data was
mounted.

On a device with FBE, these keywords wouldn't be used; on a device with
FDE, we'd use them to bring down the right processes after the user has
entered the correct secret, and restart them.

Bug: 118485723
Test: manually verified process list
Change-Id: I16adb776dacf1dd1feeaff9e60639b99899905eb
2019-04-26 14:04:59 +02:00
Joseph Jang 57f086ea4c Merge "init: Add reboot timeout handler"
am: 67231474fe

Change-Id: I233976350653d41b76c1413aa4b6212b4a206a13
2019-04-26 01:40:51 -07:00
Misha Wagner 2ded863997 Merge "Add UID printing to tombstone headers"
am: 79474ce6f3

Change-Id: I9284850d1dafe216e44feb041c21ca78a8ec64ee
2019-04-26 01:40:11 -07:00
Joseph Jang 67231474fe Merge "init: Add reboot timeout handler" 2019-04-26 08:23:06 +00:00
Misha Wagner 79474ce6f3 Merge "Add UID printing to tombstone headers" 2019-04-26 08:22:17 +00:00
josephjang aaddf282ec init: Add reboot timeout handler
In order to prevent device stuck at reboot, we try to create shutdownt
monitor thread with a timeout (default 30s). It will dump init process
and blocked tasks call trace in last kmsg then trigger kernel panic to
reboot device.

Test: reboot device

bug: 128561401
Change-Id: Ieb400ab9fbd983544b61241a4f4b8aa2f4baa863
2019-04-26 06:02:09 +08:00
Ian Kasprzak e285dbeae3 Merge "Revert "Add a way to turn off unique_fd's operator int.""
am: e30fe5fe89

Change-Id: Icfde91e105016922777dc24e0676de9b88b42058
2019-04-25 10:24:50 -07:00
Ian Kasprzak e30fe5fe89 Merge "Revert "Add a way to turn off unique_fd's operator int."" 2019-04-25 17:16:55 +00:00
Tom Cherry b7ff39410f Merge "liblog: remove LIBLOG_WEAK"
am: 81f5424560

Change-Id: Ib47fb2cf497fd76159614ae8f8da4383761ee882
2019-04-25 08:59:31 -07:00
Ian Kasprzak 2c58e1924a Revert "Add a way to turn off unique_fd's operator int."
This reverts commit 93d63c010a.

Reason for revert: b/131312539 - All aosp-master-with-phones phones failing boot / health check.

Change-Id: Id4239f93484b7d6b8d9bcd355a59cbd40d9766e2
2019-04-25 15:59:28 +00:00
Tom Cherry 81f5424560 Merge "liblog: remove LIBLOG_WEAK" 2019-04-25 15:43:36 +00:00
Josh Gao 1c6d4f3663 Merge "adbd: reduce queue depths."
am: 0fcd9292c4

Change-Id: Ib73e5111a82c42627df6a8645f58db8a7831bba6
2019-04-24 18:24:49 -07:00
Josh Gao 0fcd9292c4 Merge "adbd: reduce queue depths." 2019-04-25 01:09:23 +00:00
Tom Cherry 927c3d9184 liblog: remove LIBLOG_WEAK
I'm not sure why I didn't remove this when I got rid of the other
functions marked as weak.

Test: build
Change-Id: I45e6bca7be0497e33be88d15afea8bb1d5165380
2019-04-24 17:24:23 -07:00
Nick Kralevich ba658099a6 Merge "logd: remove SELinux dup handling"
am: 8e6fb82af6

Change-Id: Ifaf6e94171bf99a52fa78697de1aa8ec1047651b
2019-04-24 17:21:04 -07:00
Treehugger Robot 8e6fb82af6 Merge "logd: remove SELinux dup handling" 2019-04-25 00:06:43 +00:00
Dongwon Kang 47a38645c4 Merge "Fix a warning on namespace.media.link.default.shared_libs"
am: 4b43299132

Change-Id: I3dfe37d3c9155071bcdcc20a091d38b472b36b1e
2019-04-24 16:28:02 -07:00
Treehugger Robot 4b43299132 Merge "Fix a warning on namespace.media.link.default.shared_libs" 2019-04-24 23:16:37 +00:00
Josh Gao 7653723999 Merge "Add a way to turn off unique_fd's operator int."
am: 971bae0bcf

Change-Id: I8940d68e1a60ee800df6512da8c269edec7018fe
2019-04-24 16:04:06 -07:00