Commit graph

52637 commits

Author SHA1 Message Date
Treehugger Robot
db11fdcca3 Merge "fs_mgr: overlayfs: fsck scratch filesystem" 2019-10-04 16:13:06 +00:00
Yifan Hong
36749bd6d0 Merge "Convert SnapshotStatus to proto" 2019-10-04 01:59:23 +00:00
Yifan Hong
5fcc2b5d71 Convert SnapshotStatus to proto
Also, add a "name" field to SnapshotStatus, and delete
the "name" arg from CreateSnapshot / WriteSnapshotStatus.
ReadSnapshotStatus will warn if the name mismatches from
the file name, and auto-correct it.

Test: libsnapshot_test

Change-Id: I725cf39c07684b100b140a8a21ea9d23ab9d2241
2019-10-03 14:26:01 -07:00
Yifan Hong
58ae8d4780 Merge changes I7bb0b559,If147df2d,I25d7d590
* changes:
  libsnapshot: Skip initializing snapshot if not created.
  libdm: Fix DmTable::num_sectors
  Fix fds libdm_test
2019-10-03 18:58:38 +00:00
Treehugger Robot
c37e3f01ee Merge "liblog: use EXPECTED_STREQ for strings" 2019-10-03 18:40:32 +00:00
Christopher Ferris
45b570530b Merge "Fix static GetLoadBias function." 2019-10-03 16:29:48 +00:00
Tom Cherry
0de52e92dc liblog: use EXPECTED_STREQ for strings
These tests are flaky, but we're not seeing what the failure strings
are.

Bug: 142041379
Test: force a failure and see the right error message
Change-Id: Icd7777e5c309cac3b98ce65925980965a3cc3753
2019-10-03 07:32:24 -07:00
Tom Cherry
685949daad Merge "liblog: remove superfluous checks" 2019-10-03 13:58:35 +00:00
Tom Cherry
47fdf666fb Merge "liblog: don't set transports to nullptr when they close" 2019-10-03 13:58:09 +00:00
Jiyong Park
571e68efec Merge "public libs from APEXes are pre-loadable" 2019-10-03 11:37:22 +00:00
George Burgess IV
50816f0c21 Merge "lmkd: fix an uninit value bug" 2019-10-03 05:59:02 +00:00
Alex Buynytskyy
dd7288d83b Merge "Addressing comments in 1130236." 2019-10-03 04:02:11 +00:00
Jiyong Park
62870e295d public libs from APEXes are pre-loadable
This change fixes a bug that public libs from APEXes are never
pre-loaded. This was happening because those libs are removed by
InitDefaultPublicLibraries which was originaly designed for listing up
the libs that needs to be provided to the app namespace from the default
namespace. Since the libs from APEXes are not available from the default
namespace, but from their own namespaces (e.g."runtime", etc.), the
removal was fine. But the problem happend when the same function is
parameterized (with bool for_preload) and used to get the libs for
preloading.

This change fixes the problem by not removing the libs from APEXes when
the function is called with for_preload == true.

Bug: 141847343
Test: m
Change-Id: I9edf2f94bac473ac7d0651514a2dabe976f81058
2019-10-03 11:58:29 +09:00
Christopher Ferris
6c8ac56296 Fix static GetLoadBias function.
The load bias value set in ReadProgramHeaders is out of sync with the
algorithm used in the static GetLoadBias function.

Sync the two and add tests to verify that they stay in sync.

Test: Unit tests pass.
Change-Id: I20ac0104970a22a92a5314a41dcadad0c9c22e64
2019-10-02 17:53:46 -07:00
Elliott Hughes
22e6759102 Merge "libstats: remove copy of cruft removed from liblog." 2019-10-03 00:46:54 +00:00
Alex Buynytskyy
a1d6f4a41c Merge "FastDeploy refactor: 2+GB APK support, optimizations, tests." 2019-10-02 23:53:48 +00:00
Alex Buynytskyy
0c2819fc9d Addressing comments in 1130236.
Use Unicode versions of mktemp function.
Correctly handle unset TMP variable in tests.

Test: atest libbase_test
Change-Id: I5009962d33b224c4d5f39102e03daeb0837f1525
2019-10-02 16:48:22 -07:00
Bowgo Tsai
b0f90aa702 Merge "Support loading system_ext_property_contexts" 2019-10-02 23:02:37 +00:00
Treehugger Robot
5cd5da9e54 Merge "liblog: replace crufty min macro with existing MIN." 2019-10-02 21:45:55 +00:00
Tom Cherry
990852ff7d liblog: remove superfluous checks
More checks in static functions where all callers always satisfy them.

Test: build
Change-Id: I3c9bd1fd4e5c55a2f9f2c42d5259c5cdd8f8a853
2019-10-02 14:27:04 -07:00
Tom Cherry
97ec4eecd4 liblog: don't set transports to nullptr when they close
The old code did not free the transports, just unlink their nodes from
the linked list, so there was no race condition between close() and
other threads writing to the logs.  By settings these to nullptr, I
introduced a race condition, but setting them to nullptr isn't
necessary, so let's simply not do that.

Test: liblog-unit-tests
Change-Id: Iec0b680addd13b5d30bd91ccef5bdeab6bf797b0
2019-10-02 14:22:07 -07:00
Mark Salyzyn
63f97b6f49 fs_mgr: overlayfs: fsck scratch filesystem
Enable fsck phase for scratch filesystem.  Solved a resulting
problem where the end of the fsck executable would result in a
SIGHUP to the caller.

Add some debugging details from adb-remount-test.sh script

Test: adb-remount-test.sh
Bug: 138577868
Bug: 139283818
Bug: 139226412
Change-Id: I129d86b7cf4e938001ba6db8d03247bc9903988d
2019-10-02 13:30:07 -07:00
Alex Buynytskyy
665f3ff5a7 FastDeploy refactor: 2+GB APK support, optimizations, tests.
- removed 2GB apk size cap,
- removed zip archive parsing on device (1.1M->236K agent size reduction),
- optimized matching entries search,
- added more robust matching entries search based on hash of CDr entry,
- reduced patch size by reusing Local File Header of matched entries,
- removed extra manifest parsing and extra agent calls,
- added device-side tests for agent,
- fix for Windows patch creation.

Test: atest adb_test fastdeploy_test FastDeployTests

Total time for 0-size patch reduction for 1.7G apk: 1m1.778s->0m36.234s.

Change-Id: I66d2cef1adf5b2be3325e355a7e72e9c99992369
2019-10-02 13:25:03 -07:00
George Burgess IV
c73e065946 lmkd: fix an uninit value bug
Caught by clang's static analyzer:
system/core/lmkd/lmkd.c:930:9: warning: 1st function call argument is an
uninitialized value [clang-analyzer-core.CallAndMessage]

Bug: None
Test: TreeHugger
Change-Id: I9dc8e97d6aa22ea977fa06553d957a31a9df8819
2019-10-02 19:55:41 +00:00
Treehugger Robot
c63ef7fc36 Merge "Using WideChar->UTF8 versions of Windows API to obtain temp folder." 2019-10-02 19:46:36 +00:00
Elliott Hughes
6efbda7309 liblog: replace crufty min macro with existing MIN.
The "branchless" macro generates slightly worse code than std::min or
<sys/param.h>'s MIN.

Test: treehugger
Change-Id: I92c17325383bd6116c7b4736d42f01f7a9bb81a3
2019-10-02 12:27:03 -07:00
Elliott Hughes
b55731d883 libstats: remove copy of cruft removed from liblog.
Test: treehugger
Change-Id: Id336758cd435393f2013d8e643d3784ee1820b1e
2019-10-02 12:03:23 -07:00
Yifan Hong
9ae5a6ccaa Merge "libsnapshot: Return path if snapshot is already merged" 2019-10-02 18:11:33 +00:00
Treehugger Robot
3d8fbfada6 Merge "lmkd: Avoid potential out of buffer write" 2019-10-02 16:29:27 +00:00
Treehugger Robot
4fea237bf3 Merge "Refactor mini-keyctl and split a static library" 2019-10-02 16:17:47 +00:00
Treehugger Robot
9a7e1eff5a Merge "Move fsverity_init to after class_start core" 2019-10-02 16:17:47 +00:00
Treehugger Robot
6547c276fe Merge "Delete fsverity_init.sh for the C++ implementation" 2019-10-02 16:17:47 +00:00
Suren Baghdasaryan
c763c399a9 Merge "lmkd: Change meminfo_log into killinfo_log and log additional fields" 2019-10-02 14:20:28 +00:00
Greg Kaiser
724a1616d5 lmkd: Avoid potential out of buffer write
Our buffer needs enough space for the '\0' terminator character
as well.

Test: TreeHugger
Change-Id: Ib85d08dacf87b93d5f8b35b033ca0ec478868e66
2019-10-02 07:07:32 -07:00
Tom Cherry
173e4ba26a Merge "liblog: remove more endianness functions" 2019-10-02 14:03:04 +00:00
Tom Cherry
bc4e9cb94e Merge changes I8a31ad3a,I8b385d51,I3fdcdc33,Ia4571cd3
* changes:
  liblog: remove a few unused items
  liblog: fix prio and tag validation code
  liblog: remove config_write.cpp/.h
  liblog: remove log/log_transport.h
2019-10-02 14:02:11 +00:00
Bowgo Tsai
1a191bf54d Support loading system_ext_property_contexts
Commit I27dd391fc06a3c78e88a65c7931c84de1699f157 makes property_service
no longer load selinux property_contexts by function
selinux_android_prop_context_handle.

So we should load property_contexts from /system_ext as well in
property_service.cpp.

Bug: 137712473
Bug: 141871131
Test: `adb shell getprop -Z` to check system_ext_property_contexts is loaded
Change-Id: I49c5c725784c0d598062ae356be6226446f4942a
2019-10-02 09:24:56 +00:00
Tom Cherry
d1ad89534a liblog: remove more endianness functions
And fix a mistake from the earlier CL.

Bug: 141962035
Test: liblog-unit-tests
Change-Id: Id41c47e760f79c0e8bdea54f3644752e2bf7494e
2019-10-02 03:28:49 +00:00
Yifan Hong
1d99674e5d libsnapshot: Skip initializing snapshot if not created.
If no opeartions is to be executed on a partition, it is
possible that no snapshot is created for it. In that case,
don't crash when initalizing snapshots.

Test: libsnapshot_test
Change-Id: I7bb0b5596aa6e4eca319e9c88f6552d1907a6944
2019-10-01 19:43:33 -07:00
Yifan Hong
55fb297a0c libdm: Fix DmTable::num_sectors
Test: libdm_test
Change-Id: If147df2d5c4f3b3df7ca57200f16a9ad59ae8327
2019-10-01 19:43:33 -07:00
Yifan Hong
9c7903124c Fix fds libdm_test
Failed because of double free of fds.
Test: run it

Change-Id: I25d7d590ca52d57fb14a5483ff8751127f6a48a6
2019-10-01 19:43:33 -07:00
Alex Buynytskyy
43f0b0c4ba Using WideChar->UTF8 versions of Windows API to obtain temp folder.
This will correctly handle non-ascii chars in paths.
+Windows specific tests for non-unicode chars and root of disk as a temp
folder.

Test: atest libbase_test

Change-Id: Ief3ee26df93e122250441bfe41f0440fe62bfadc
2019-10-02 02:22:23 +00:00
Treehugger Robot
2becdb6579 Merge "libnativeloader: fix typo in README.md" 2019-10-02 02:02:53 +00:00
Treehugger Robot
c4876f1905 Merge "adb: disable failing test." 2019-10-02 01:00:41 +00:00
Tom Cherry
0f6ea6e8b6 liblog: remove a few unused items
Test: build
Change-Id: I8a31ad3a9fcd6f74f3a0221d38b64e8e2ea7ea2d
2019-10-01 17:29:13 -07:00
Tom Cherry
2187a41586 liblog: fix prio and tag validation code
These checks are not needed; all callers are in this file and there's
only one possible situation: that we have valid pointers and sizes.

Test: liblog-unit-tests, log.tag.* properties still work
Change-Id: I8b385d5124c2d93cd99a352e30f745b075c8bd09
2019-10-01 17:13:43 -07:00
Treehugger Robot
3e71c06d90 Merge "libprocessgroup: add support to set aggregate profiles" 2019-10-01 23:46:34 +00:00
Suren Baghdasaryan
a7ac578a9f lmkd: Change meminfo_log into killinfo_log and log additional fields
meminfo_log is used to log the state of the memory at the time of a kill.
Instead of reporting kill information and meminfo separately let's combine
them into one killinfo_log report. While normal logs can be trimmed by
chatty, meminfo_log uses a separate log context which gives it a better
chance of survival. As a result we will have all the information relevant
to a kill in one report which has higher chance of surviving chatty.

Bug: 74119935
Test: lmkd_unit_test
Change-Id: I83a9c12d538e1fb107721b04fdafc3c6c0d83b60
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-10-01 23:26:56 +00:00
Treehugger Robot
9a66161585 Merge "Fix memory leak in String16" 2019-10-01 23:17:30 +00:00
Treehugger Robot
88f50f536f Merge "Remove references to /sys/android_power/*" 2019-10-01 22:25:54 +00:00