Commit Graph

58660 Commits

Author SHA1 Message Date
Tom Cherry 62068bfb4a liblog: remove __android_logger_property_get_bool()
All users have been moved to other, more suitable, interfaces.

Test: build
Merged-In: Ic4eb1f0ed6e35d8d6f7e63b80546f4e8bbe163e2
Change-Id: Ic4eb1f0ed6e35d8d6f7e63b80546f4e8bbe163e2
2020-07-29 19:58:30 +00:00
Tom Cherry b4bc99e873 Run liblog and logd CTS tests in presubmit
And sort the rest of the CTS tests.

Test: these tests run
Change-Id: I8eeb7b8acac2ed658b36da8463112fe1da8437a9
2020-07-29 08:02:52 -07:00
Tom Cherry 898db00675 Merge "logd: remove users of __android_logger_property_get_bool()" 2020-07-29 14:38:57 +00:00
Dan Albert ac4500e67d Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: http://b/161896447
Test: None
Change-Id: I9e5a37a20012b2f7a8eac55701df03f7b7a9ab6c
2020-07-28 15:58:25 -07:00
Christopher Ferris 0d3dde2d97 Merge "Cleanup for #inclusivefixit." 2020-07-28 21:01:52 +00:00
Tom Cherry 68261eec24 logd: remove users of __android_logger_property_get_bool()
__android_logger_property_get_bool() has a clunky API and doesn't
belong in liblog, since a vast majority of liblog users will never
query this property.

Specifically
1) Replace with GetBoolProperty() when completely equivalent.
2) Remove checking if property values are 'eng' or 'svelte', since
   there's no evidence that those values were ever used.
3) Remove checking 'persist.logd.statistics' and 'ro.logd.statistics',
   since there's no evidence that those values were ever used.
4) Set ro.logd.kernel explicitly, so other processes don't need to
   replicate the defaults that logd uses.

Test: build
Change-Id: I7c37af64ba7754e839185f46da66bf077f09d9c3
2020-07-28 13:16:11 -07:00
Elliott Hughes b0a9d0e703 Merge "Cleanup for #inclusivefixit." 2020-07-28 19:33:58 +00:00
Treehugger Robot 6949036229 Merge "Cleanup for #inclusivefixit." 2020-07-28 19:33:41 +00:00
Christopher Ferris 4f7a0f8c7c Cleanup for #inclusivefixit.
Bug: 161896447

Test: NA
Change-Id: I8bc5b4be29f91b1884017aa3b4f28d91d9cac419
2020-07-28 12:08:03 -07:00
Elliott Hughes 2c89f97f0a Cleanup for #inclusivefixit.
Test: treehugger
Change-Id: I44f710cbda4497c9d01a1ff7c1dcdb8f0eda6acc
2020-07-28 11:11:55 -07:00
Elliott Hughes e79b8c2092 Cleanup for #inclusivefixit.
Test: treehugger
Change-Id: I651689e2d59c017a9bde44251d95b57e594f0b5b
2020-07-28 11:09:03 -07:00
Jaegeuk Kim c69d79fe77 Merge "add generic symlink to access userdata sysfs" 2020-07-28 17:03:35 +00:00
Treehugger Robot 5ce349927d Merge "Use more inclusive language for #inclusivefixit" 2020-07-28 13:28:52 +00:00
Treehugger Robot 71db317340 Merge "Use more inclusive language for #inclusivefixit" 2020-07-28 12:03:43 +00:00
Treehugger Robot 1d098a7db5 Merge "Use more inclusive language for #inclusivefixit" 2020-07-28 11:49:42 +00:00
Treehugger Robot ab89a928d1 Merge "Cleanup for #inclusivefixit." 2020-07-28 09:46:41 +00:00
Mohammad Islam ccc3ddda99 Merge "Add StagedInstallInternalTest to adb TEST_MAPPING file" 2020-07-28 08:49:40 +00:00
Hongguang Chen f79b6ab2dd Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: make
Change-Id: If9a382c33703c8508a8ec9b4219c487e0ff9a79d
2020-07-28 00:22:59 +00:00
Jaegeuk Kim 43dca3c8be add generic symlink to access userdata sysfs
This patch adds fixed location to access sysfs entries by introducing:
/dev/sys/fs/by-name/userdata -> /sys/fs/f2fs/dm-<num>
/dev/sys/block/by-name/userdata -> /sys/block/dm-<num>

Bug: 144277579
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I1b3768005fc8720694bace05292a1b1171d60e3c
2020-07-27 23:58:36 +00:00
Hongguang Chen a41111070c Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: make
Change-Id: I85a9f48fbab79b3b68f00c0af68750c616d815f8
2020-07-27 22:54:22 +00:00
Hongguang Chen 714adb834a Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: make
Change-Id: I6f1668d1f7925393c72db6ae282003a9ecc723b7
2020-07-27 15:52:32 -07:00
Mohammad Samiul Islam d5c8aaac06 Add StagedInstallInternalTest to adb TEST_MAPPING file
StagedInstallInternalTests contains test that verify staged installation
using adb commandline (e.g `adb install`) is working correctly.

Bug: 158314277
Test: atest --test-mapping system/core
Change-Id: Icc3bd464a91f31095316fbb85941e5e03089aaad
2020-07-27 20:15:06 +01:00
Tom Cherry 2d451663be Cleanup for #inclusivefixit.
Test: build
Change-Id: If11a32c130367560394eccf442de95d941918073
2020-07-27 11:37:19 -07:00
Songchun Fan 34d65037e9 [incremental/adb] fix signature size check
Should check signature block size, not file size

Test: manual
BUG: 157077910
Change-Id: I6f03af58532b3c518c447f6e7407ebfc0ba37b44
2020-07-27 09:45:35 -07:00
Tom Cherry 864a2dbee5 Merge "logd: use the compressed (serialized) log buffer by default" 2020-07-27 16:35:59 +00:00
Jaegeuk Kim 8d5bbec4c1 Merge "rootdir/init.rc: enable iostat by default" 2020-07-25 02:09:33 +00:00
Jaegeuk Kim 8d8edad443 rootdir/init.rc: enable iostat by default
Bug: 152162885
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: If95e30c7d3bfec621dfde9452a6eda5211c64a2b
Merged-In: If95e30c7d3bfec621dfde9452a6eda5211c64a2b
2020-07-25 00:20:47 +00:00
David Anderson 67665a4571 Merge changes I49495684,I0db2e0f4,I07bb811b
* changes:
  init: Initiate other misc devices from BlockDevInitializer.
  Allow snapuserd to be included in the initial ramdisk.
  Add experimental daemon for handling dm-user requests.
2020-07-24 19:18:45 +00:00
Elliott Hughes ba1bd64ca2 Merge "debuggerd: use One True timestamp function." 2020-07-24 15:47:03 +00:00
Hung-ying Tyan d1bd5f20eb Merge "init: set $PATH in second stage init" 2020-07-24 03:01:33 +00:00
Elliott Hughes a660cb3f13 debuggerd: use One True timestamp function.
An OEM asks for sub-second granularity, and that's most easily done if
we only have one timestamp generator. I'm not convinced sub-second
granularity is particularly useful myself, and I definitely don't think
that nanosecond resolution is meaningful but I do like this cleanup, and
if I'm going to use sub-second precision I may as well use the maximum
precision available to me.

Also reduce some duplication of code reading cmdline/comm.

Bug: https://issuetracker.google.com/161860597
Test: head /data/tombstones/*
Change-Id: I035ecfd4a3338ccd84dae0ef973a998a7c7c5056
2020-07-23 16:33:53 -07:00
Hongguang Chen 628f288f8a Merge "Use more inclusive language for #inclusivefixit" 2020-07-23 23:04:33 +00:00
Hongguang Chen f248cc5a98 Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: make
Change-Id: I3e43a9a0f09b0587ec95de886705f03c1a430ef6
2020-07-23 11:13:37 -07:00
Tom Cherry d36f4a36ed init: set $PATH in second stage init
If the system partition has been updated and _PATH_DEFPATH has a new
value, then we must set $PATH in second stage init to take on the new
value, as well as having set it in first stage init.

Bug: 160210288
Test: build
Change-Id: I18765709dc9bff9379b0ae39272199cf74a79d2f
2020-07-23 09:13:37 -07:00
Tom Cherry bc72197b33 logd: use the compressed (serialized) log buffer by default
The serialized log buffer along with compression results in:
* ~3.5x more logs than chatty
* Less CPU usage
* Less memory usage
* Equivalent log range

Also, delete tests that assume that the device logd implementation is
chatty.  There are actual unit tests for this same behavior that don't
rely on the device logd.

Test: serialized log buffer is used
Change-Id: Ie12898617429a75b6caff92725aa7145650f8fc6
2020-07-22 20:21:09 -07:00
Treehugger Robot b8bcd11f8b Merge "Use more inclusive language for #inclusivefixit" 2020-07-23 02:14:16 +00:00
Hongguang Chen 5330ccdd5b Use more inclusive language for #inclusivefixit
Updating language to comply with Android’s inclusive language guidance.

See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: Trivial changes
Change-Id: Ia84d47930b5d9ca4a5f7c809777c886bece4f512
2020-07-23 01:23:45 +00:00
Tri Vo 28215f8d36 Merge "trusty: spi: Add SPI proxy daemon" 2020-07-22 23:26:00 +00:00
Tri Vo 4e94e5bcfa trusty: spi: Add SPI proxy daemon
Bug: 118762930
Test: /data/nativetest64/trusty-ut-ctrl/trusty-ut-ctrl \
-D /dev/trusty-ipc-dev0 com.android.trusty.swspi.test

Change-Id: I6589009b2570f1101fed73197997d31a454887eb
2020-07-22 11:19:02 -07:00
Peter Collingbourne 4058c5cf59 Merge changes from topics "I1e5610d1353b4f5b718c1259825421c0c07d7c24", "I52da338347ff6b7503cf5ac80763c540695dc061", "I94e4b7124b7735b92fd83a49c80ebded3483cd4e"
* changes:
  Include memory tags in memory dump output.
  Adjust conditions for dumping the memory around a register.
  Statically link libminijail to debuggerd_test.
2020-07-22 18:04:17 +00:00
Peter Collingbourne fe8997aff8 Include memory tags in memory dump output.
Tags appear in the addresses printed in the memory dump, which seems
like a reasonable place to put them because tagged addresses will
also appear in other places in the tombstone, such as registers and
the fault address.

Bug: 135772972
Change-Id: I52da338347ff6b7503cf5ac80763c540695dc061
2020-07-21 19:05:16 -07:00
Peter Collingbourne b1fcedb928 Adjust conditions for dumping the memory around a register.
Previously, we would do a simple bounds check before deciding
whether to dump the memory around a register. On 64-bit platforms,
the register's value was required to be less than (4 << 60). However,
after stripping tags on AArch64 as part of r.android.com/1365229, all
pointer values became less than (4 << 60), so the check became useless
for filtering out invalid pointers. As a result, we would attempt to
dump memory for all registers, which for a register not containing
a valid pointer would typically consist of 16 lines of dashes.

One possible fix may be to replace the constant (4 << 60) with the
process's actual address space limit (known as TASK_SIZE inside the
kernel; typically 39 bits on AArch64 and 48 bits on x86_64), but the
kernel provides no API for retrieving a process's TASK_SIZE value. We
could guess it by looking at for example the highest bit set in the
value of getauxval(AT_EXECFN), which points to an address on the stack
which typically is mapped at the end of the address space on program
startup, but at least on AArch64 it is possible to dynamically extend
TASK_SIZE at runtime by providing a hint to mmap(), so this is not
always sufficient.

Instead, it seems best to remove most of the early bounds check, and
simply issue ptrace() calls for each register value, bailing out of
the entire output if none of the calls ended up succeeding. This also
has the nice side effect of avoiding 16 lines of noise per register
whose value looks like a pointer but actually points to unmapped
memory. We still retain part of the bounds check in order to avoid
integer overflow during the dump (including overflows into the tag
part of the address on architectures that support tagging).

Bug: 154272452
Change-Id: I94e4b7124b7735b92fd83a49c80ebded3483cd4e
2020-07-21 16:59:24 -07:00
Peter Collingbourne d00a577c97 Statically link libminijail to debuggerd_test.
We do not install a 32-bit version of libminijail to 64/32 devices,
which means that "atest -a debuggerd_test" always fails on 32-bit.
Fix it by statically linking libminijail.

Change-Id: I1e5610d1353b4f5b718c1259825421c0c07d7c24
2020-07-21 16:59:24 -07:00
Tom Cherry e122701142 Merge "Ueventd: Fix a corner case in ReadUevent() that triggers duplicate firmware loading." 2020-07-21 21:14:52 +00:00
Tom Cherry dfdc9b105a Merge "ueventd: bump UEVENT_MSG_LEN to 8192" 2020-07-20 22:24:14 +00:00
P.Adarsh Reddy a86bf05a01 Ueventd: Fix a corner case in ReadUevent() that triggers duplicate firmware loading.
Presently, within ReadUevent(), true is returned for a successful case
as well as for the case where we read an invalid uevent (overflowed
buffer)where the Uevent object is not cleared, and the caller calls the
callback (with the earlier stored uevent object),leading to duplicate
firmware loading.

Uevent uevent;
while (ReadUevent(&uevent)) {
  if (callback(uevent) == ListenerAction::kStop) return;
}

Scenario:
1. Proper Uevent received and callback is called (firmware loading
   is triggered).
2. Overflowed uevent is received as part of the same ReadUevent session,
   ReadUevent() returns true, but the uevent object is not cleared and
   still has earlier event values.
3. Callback is called again, leading to duplicate firmware load.

Handle it by adding explicit return codes to let the caller know if the
uevent read is invalid, and the caller can ignore it and read
further pending uevents.

Bug: 161580785

Change-Id: I09e80052337fd1495b968dc02ecff5ceb683da18
2020-07-21 03:09:28 +05:30
Jaegeuk Kim a389610d9c support f2fs casefolding formatting tool
Bug: 159672232
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: Ia9dd5d63f03c2365b5d82a84ff93263424f116bb
2020-07-20 13:18:09 -07:00
Tom Cherry 939b41c79b ueventd: bump UEVENT_MSG_LEN to 8192
The previous size, 2048, is only the size of the 'environment' for the
uevent message, but doesn't include the <action>@<dev path> portion.
The <action> portion has a max length < 10, but the <dev path> portion
is unbounded.

8192 should be plenty to capture all of these parameters.

Bug: 161580785
Test: ueventd still works
Change-Id: I6de6fd3a444ac91b3b4df154097abde3696e21b3
2020-07-20 13:18:01 -07:00
Tom Cherry 7a6191ce2e Merge "logd: record and replay log messages" 2020-07-20 15:44:44 +00:00
Peter Collingbourne af7c3d5873 Merge "Fix dumping of heap memory." 2020-07-18 02:06:45 +00:00