Commit Graph

55483 Commits

Author SHA1 Message Date
Elliott Hughes 00ff8d7021 adb: make the push summary fit in 80 columns.
Elide $ANDROID_PRODUCT_OUT for a large saving:

  /data/: 2 files pushed. 734 files skipped. 6.5 MB/s (830776 bytes in 0.122s)
  /product/: 0 files pushed. 357 files skipped.
  /system/: 7 files pushed. 2638 files s...d. 16.3 MB/s (3785511 bytes in 0.221s)
  /system_ext/: 1 file pushed. 90 files ...d. 13.2 MB/s (1152016 bytes in 0.084s)
  /vendor/: 0 files pushed. 200 files skipped.

And drop the repeated "files" when talking about how many were skipped
for a small saving:

  /data/: 2 files pushed, 734 skipped. 6.4 MB/s (830776 bytes in 0.124s)
  /product/: 0 files pushed, 357 skipped.
  /system/: 7 files pushed, 2638 skipped. 13.8 MB/s (3785511 bytes in 0.262s)
  /system_ext/: 1 file pushed, 90 skipped. 12.2 MB/s (1152016 bytes in 0.090s)
  /vendor/: 0 files pushed, 200 skipped.

Bug: http://b/131717844
Test: adb sync
Change-Id: I9d24df49498211bc2b8dcebcc6d8bd557da214c1
2020-01-27 10:05:36 -08:00
Daniel Rosenberg be27975fff Merge "Support casefolded encryption" 2020-01-24 02:09:55 +00:00
Treehugger Robot f3700b9e42 Merge "libsnapshot: fix null pointer deref" 2020-01-24 01:12:33 +00:00
Mike Ma e3a7783686 Merge "Relax permissions on /data/misc/logd" 2020-01-24 01:04:03 +00:00
Josh Gao 427006042c Merge "Build test_com.android.adbd.apex." 2020-01-23 23:58:43 +00:00
Treehugger Robot 071c4b37e8 Merge "When encountered an unexpected status, mention it" 2020-01-23 21:30:31 +00:00
Yifan Hong 39de68cb6d libsnapshot: fix null pointer deref
Bug: 148129196
Test: TH
Change-Id: If6a628fe1bcb3006c7a21021162488a807a7f9f7
2020-01-23 12:58:25 -08:00
Treehugger Robot b40c15e101 Merge "Move default tag from libbase to liblog" 2020-01-23 20:32:25 +00:00
Josh Gao 7da5d8a977 Build test_com.android.adbd.apex.
Build a test apex with an INT_MAX version code for the purposes of
update/rollback testing.

Test: atest adbd_e2e_tests # in internal master
Change-Id: I0e616db03dcbc940af2741dfca5b4c5f50a5a654
2020-01-23 11:55:03 -08:00
Christopher Ferris 8bf4e29e44 Merge "Properly handle empty map after read-only map." 2020-01-23 17:45:26 +00:00
Tom Cherry 69ee5dde99 Move default tag from libbase to liblog
Bug: 119867234
Test: log tags look right, libbase/liblog unit tests
Change-Id: I3670c3fdce3d0238a23a53bba2877ffed1291f9c
2020-01-23 08:39:31 -08:00
Elliott Hughes f8c0350eaa Merge "debuggerd: remove the raw stack dump." 2020-01-23 16:07:42 +00:00
Treehugger Robot 2148b252c2 Merge "Use SOONG_HOST_OUT_EXECUTABLES" 2020-01-23 16:02:29 +00:00
Baligh Uddin 3d902d1637 Use SOONG_HOST_OUT_EXECUTABLES
Bug: 147699225
Test: m com.android.tzdata (apexer requires these executables)
Change-Id: I008d244e330d2113cb3f2dd4b6c770df3f2fac06
2020-01-23 14:09:01 +00:00
Treehugger Robot cfd517d2a0 Merge "fastbootd: exporting more properties" 2020-01-23 07:34:09 +00:00
Daniel Rosenberg 8775ce017d Support casefolded encryption
On ext4, enable casefolding if it is requested, but not currently
enabled.

Test: Enable casefolding on device. Check fs configuration on /data
Bug: 138322712
Change-Id: I3d54ab8bf15f28cf52c5b4344aa3fa254af83d60
2020-01-22 20:33:53 -08:00
Christopher Ferris 0f40a05309 Properly handle empty map after read-only map.
Recently, the maps for an elf in memory might show up looking like:

  f0000-f1000 0 r-- /system/lib/libc.so
  f1000-f2000 0 ---
  f2000-f3000 1000 r-x /system/lib/libc.so
  f3000-f4000 2000 rw- /system/lib/libc.so

The problem is that there is logic in the code that assumed that the
map before the execute map must be the read-only map. In the case
above, this is not true. Add a new prev_real_map that will point
to the previous map that is not one of these empty maps.

This will fix the backtraces that look like this:

  #00  pc 0000000000050d58  /apex/com.android.runtime/lib64/bionic/libc.so!libc.so (offset 0x50000) (syscall+24) (BuildId: 5252408bf30e395d49ee270b54c77ca4)

To get rid of the !libc.so and the offset value, which is not correct.

Added new unit tests to verify this.
Added new offline test which an empty map between read-only and execute
map. Before this change, the backtraces had lines like
libc.so!libc.so (offset XXX) would be present.

Bug: 148075852

Test: Ran unit tests.
Change-Id: Ie04bfc96b8f91ed885cb1e655cf1e346efe48a45
2020-01-22 18:30:12 -08:00
Stephane Lee 223fa17c2e Merge "Populate fields for health HAL 2.1 + batteryCapacityLevel + batteryChargeTimeToFullNow" 2020-01-23 00:39:07 +00:00
Oliver Nguyen 38b33c09f9 Merge "Set Clang coverage environment variables." 2020-01-22 22:34:35 +00:00
Elliott Hughes 627928e059 debuggerd: remove the raw stack dump.
This takes a lot of space, isn't convincingly useful, and makes it
likely that the far more valuable stuff that comes after it gets
truncated. So let's just drop it.

Bug: http://b/139860930
Test: manual crasher, presubmit
Change-Id: Ie417ffc07e3cb17e95fdb3d183f8c87de0f34b89
2020-01-22 14:13:46 -08:00
Treehugger Robot eba798a767 Merge "Harden /mnt/pass_through permission bits" 2020-01-22 21:30:53 +00:00
Treehugger Robot 4169e9e47d Merge "stats_event.h/c tests" 2020-01-22 20:50:09 +00:00
Ruchir Rastogi c6e6c44e50 stats_event.h/c tests
Add unit tests for the native API to log atoms to statsd.

(This CL is being cherrypicked into AOSP in order to prevent automerger
issues with the rename from libstatssocket to libstatspush.)

Test: bit libstatssocket_test:*
Bug: 145231901
Change-Id: If427c17319787200260cbe3b71075ca556c9a82b
Merged-In: If427c17319787200260cbe3b71075ca556c9a82b
2020-01-22 11:43:01 -08:00
Treehugger Robot 929c9e8b40 Merge "liblog: check loggability before formatting" 2020-01-22 19:16:11 +00:00
Stephane Lee 86f9f6aed5 Populate fields for health HAL 2.1
+ batteryCapacityLevel
+ batteryChargeTimeToFullNow

Bug: 137790244
Test: lshal debug (health service)
Change-Id: Ieb0b42e6cdded5974f01198ee151453367f82579
2020-01-22 10:50:05 -08:00
Zim 6ca090e6b0 Harden /mnt/pass_through permission bits
It previously had 0755 permission bits

With such permissive bits, an unauthorized app can access a file using
the /mnt/pass_through path for instance even if access via /storage
would have been restricted.

It is now 0700

TODO: Change ACL for /mnt/user from 0755 to 0700 in vold only when
FUSE flag is on. Changing it with FUSE off breaks accessing /sdcard
because /sdcard is eventually a symlink to /mnt/user/0/primary

Test: adb shell ls -d /mnt/pass_through
Bug: 135341433
Change-Id: I3ea9655c6b8c6b4f847b34a2d3b96784a8f4a160
2020-01-22 17:54:45 +00:00
Christopher Ferris d88210b676 Merge "Fix global finding logic." 2020-01-22 17:07:47 +00:00
Tom Cherry 96e7ef5ec1 liblog: check loggability before formatting
Only print logs with priority >= INFO on host, as fake_log_device
does.

This fixes a regression in host builds where loggability wasn't
checked at all.

Bug: 69935292
Test: ART host tests don't print extraneous logs
Change-Id: I885b794da6f24bd905192252925e4a9f88b06674
2020-01-22 08:49:59 -08:00
Bowgo Tsai 99f9a38a8b fastbootd: exporting more properties
Exporting more properties that can be useful for image compatibility
check, prior to run fastboot flash.

Bug: 74445765
Bug: 144473561
Test: fastboot getvar <new variable>
Change-Id: I2ddfa2c1e9e719e05a3a64b9ca1d608957aebf11
2020-01-22 23:29:07 +08:00
Yifan Hong e99ec483b1 Merge "SnapshotManager::WaitForMerge gives more info" 2020-01-22 03:13:16 +00:00
Mike Ma a7fb095207 Relax permissions on /data/misc/logd
Incidentd needs to access /data/misc/logd to get persisted logs for
debugging purposes. Relax permissions on /data/misc/logd to allow
group (log) to access the dir and read its files. Effectively change
to:
drwxr-x--- logd log /data/misc/logd
-rw-r----- logd log /data/misc/logd/logcat*

Since this dir stores the past output of logcat, anyone that can run
logcat can be granted access to this dir. Access to this dir is further
guarded by SELinux. So it is safe.

Bug: 147924172
Test: Build, flash, reboot. Verify that the files have the right
      permissions.

Change-Id: I4d2aa9d5883d1ef14411b2b3902f0ca7c641dd7e
2020-01-21 18:39:19 -08:00
Christopher Ferris de5cd8ccd4 Fix global finding logic.
Recently, the maps for an elf in memory might show up looking like:

  f0000-f1000 0 r-- /system/lib/libc.so
  f1000-f2000 0 ---
  f2000-f3000 1000 r-x /system/lib/libc.so
  f3000-f4000 2000 rw- /system/lib/libc.so

That empty map was confusing the logic when looking for a global
variable. Now this case is handled properly.

New unit test added for this case.

Bug: 147910661

Test: Ran unit tests.
Test: Ran original failing test 137-cfi.
Change-Id: Ida2e96d1da5e1bf61f41646949fe5a2d405c0d61
2020-01-21 18:00:57 -08:00
Josh Gao 02f535f582 Merge "adb: windows: fix adb execute root cmd with no tips" 2020-01-22 01:37:13 +00:00
Woody Chow 8db23af93b Merge "Fix unsigned integer overflow of i, which gives SIGABRT" 2020-01-22 01:14:18 +00:00
Elliott Hughes 7becf26301 Merge "Make OSTREAM_STRING_POINTER_USAGE_WARNING build even with GCC" 2020-01-22 01:06:05 +00:00
Treehugger Robot 3ddd4304f5 Merge "Snapshot merge progress percentage" 2020-01-22 00:25:50 +00:00
Tom Cherry 81c8385ab3 Merge changes Icb49b30b,Ib52cbfb4
* changes:
  Move minimum log priority from libbase to liblog
  Move SetLogger and SetAborter from libbase to liblog
2020-01-21 22:27:49 +00:00
Elliott Hughes 2353510b5a Merge "Update shell_and_utilities docs for R." 2020-01-21 21:45:59 +00:00
Yifan Hong b98a2e36ae SnapshotManager::WaitForMerge gives more info
It now returns Ok() if successful, NeedsReboot() if merge
it should be checked again after reboot, and Error() for
other errors.

This wraps UpdateState to help clients interpret the UpdateState value.

Also separate SnapshotManager::Return from FiemapStatus since they are
for different libraries and have (potentially) different set of error codes.

Test: libsnapshot_test
Bug: 138808328
Change-Id: I8c95417c2b0b7b2a362beb12585f861453a79278
2020-01-21 13:34:55 -08:00
Ryan Savitski cdebef1d2b Merge "init: add builtin check for perf_event LSM hooks" 2020-01-21 20:40:50 +00:00
Tom Cherry 0391a879f7 Move minimum log priority from libbase to liblog
See the previous commit moving SetLogger and SetAborter to liblog for
motivation.

This creates more harmony between the two mechanisms in libbase and
liblog for checking loggability.
Currently:
1) libbase filters all messages based on its minimum log priority. For
   example, if minimum log priority in libbase remained at its
   default, but a tag was specifically opted into DEBUG logs via
   log.tag.<tag>, libbase would not print this log.
2) liblog ignores libbase's minimum log priority.  For example if a
   process called SetMinimumLogPriority(WARNING) but used a library
   that logged via liblog's ALOGI macro, that log would still be
   printed even though the process intends on filtering out those INFO
   messages.

With this change:
1) If both a minimum log priority and a priority through log.tag.<tag>
   are set, then the lower of the two values is used.
2) If only one or the other is set, then that value is used.  This
   fixes the two issues described above.
3) If neither of these values are set, then the default of using INFO
   is unchanged.

Bug: 116329414
Bug: 119867234
Test: libbase and liblog minimum log priority tests
Change-Id: Icb49b30b9d93bf797470e23730ae9e537931bb6c
2020-01-21 12:14:43 -08:00
Steven Moreland 2ac625db19 Merge "libutils: sp lh comparison w/ pointer" 2020-01-21 20:14:23 +00:00
Treehugger Robot 6ea42a892f Merge "debuggerd_handler: increase thread stack size." 2020-01-21 20:00:05 +00:00
Yabin Cui 63f25aa3fa Merge "libprocinfo: remove error msg for unknown process state." 2020-01-21 19:40:15 +00:00
Yifan Hong 5e3e76520d Merge "SnapshotManager::Return -> Return" 2020-01-21 19:33:27 +00:00
Tom Cherry 349b0c43ad Move SetLogger and SetAborter from libbase to liblog
libbase is copied into each APEX module which requires it, meaning
that there may be multiple instances of libbase running within a
single process with their own copy of libbase's globals.  This means
that SetLogger() and SetAborter() will only impact logs from the
instance of libbase that calls it.  This change moves this state to
liblog, since it will only ever have one instance in a single
process.

One major side-effect here is that now both ALOGE style and LOG(...)
style logs will be handled through the same logger function.  For
example, a logger specified through libbase's SetLogger() will now see
logs sent to liblog through ALOGE().  This is intended behavior.

A second side-effect is that libbase's stderr logger is used for all
host logging now.  It's simply a better logging default than the
fake_log_device logger in liblog currently and makes ALOGE and
LOG(...) logs on host follow the same format.

Bug: 119867234
Test: libbase and liblog unit tests; logging works
Change-Id: Ib52cbfb4e43749e50910ed19a993dffae19ace86
2020-01-21 11:05:24 -08:00
Tom Cherry adfb1c6d1b Merge "Allow fuzzy_fastboot test devices over internet" 2020-01-21 18:32:17 +00:00
Treehugger Robot a78d0cb735 Merge "First working version of the confirmationui HAL service" 2020-01-21 16:40:03 +00:00
steven_fann fde5e27602 Allow fuzzy_fastboot test devices over internet
Bug: 144667236
Test: fuzzy_fastboot --serial=192.168.1.104:5555 --gtest_filter=*Logical*

Change-Id: I02e62f706d0a3a19a9b7b56788abe05759d2d63d
2020-01-21 15:40:52 +00:00
Treehugger Robot c3d94633a2 Merge "init: Fix a bug in MountDir" 2020-01-21 15:39:04 +00:00