Commit graph

55678 commits

Author SHA1 Message Date
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
Yifan Hong
04b932b8fd Add e2fsck to fs_config
Test: boot and look at serial console
Bug: 147347110
Change-Id: Ife664c02fa4cf86d9385caff734d2bb3e56d988f
2020-01-22 16:47:14 -08:00
Yifan Hong
7dd4553991 Make ramdisk_available.
Test: pass
Bug: 147347110
Change-Id: I9787e386e552393efc5beed5aac577be9ce1a3c5
2020-01-22 16:47:14 -08:00
Stephane Lee
223fa17c2e Merge "Populate fields for health HAL 2.1 + batteryCapacityLevel + batteryChargeTimeToFullNow" 2020-01-23 00:39:07 +00:00
Nikita Ioffe
4a787d96ce Whitelist reboot reasons related to userspace reboot failure
Test: system/core/bootstat/boot_reason_test.sh
Bug: 135984674
Change-Id: I31422329f1109273909293a83913ae801eb1fe52
2020-01-23 00:12:02 +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
Davide Pallotti
2acd25a33d Make OSTREAM_STRING_POINTER_USAGE_WARNING build even with GCC
This is for projects built with GCC that import parts of Android that,
despite not having Android-specific dependencies, still end up
depending on logging.h.
Also removes outdated notes.

Change-Id: I5a47b302bcaeeb935592d8fc7ad2fe5068d226c3
2020-01-21 10:54:36 +01:00
Woody Chow
7fb93c168e Fix unsigned integer overflow of i, which gives SIGABRT
Bug: 147640670
Test: None

Change-Id: I157aacbf9ddaa6a91eccd940573cf187b58e8d5e
2020-01-21 02:00:54 +00:00
Satoshi Niwa
1eb300dca5 init: Fix a bug in MountDir
mkdir always returns -1 for any types of errors.
errno should be checked for actual error type.

Test: m
Change-Id: I1b56d48ba48992a2f9629dc09d795c277b5b774d
2020-01-20 18:00:49 +09:00
Treehugger Robot
0852b10b37 Merge "[vts-core] Make VtsKernelLibcutilsTest runnable by base TradeFed" 2020-01-20 02:32:56 +00:00
Josh Gao
55c7ed4e2e debuggerd_handler: increase thread stack size.
1 page isn't enough to log on AArch64, and clean pages are free, so
increase the stack size to 8 pages.

Bug: http://b/144887737
Test: treehugger
Change-Id: I731b3bc27ab37f4b830a9478a04cd34d4f7648d3
2020-01-17 17:25:30 -08:00
Janis Danisevskis
8fe0cfb098 First working version of the confirmationui HAL service
This implementation does not provide any security guaranties.
 * The input method (NotSoSecureInput) runs a crypto protocols that is
   sufficiently secure IFF the end point is implemented on a trustworthy
   secure input device. But since the endpoint is currently in the HAL
   service itself this implementation is not secure.
 * This implementation provides most of the functionality, but not the
   secure UI infrastructure required to run Android Protected
   Confirmation.

Bug: 146078942
Test: VtsHalConfirmationUIV1_0TargetTest
Change-Id: I14717b5fa4ef15db960cdd506b8c6fe5369aec8d
2020-01-17 16:34:48 -08:00