Commit graph

47891 commits

Author SHA1 Message Date
Jiyong Park
875326a506 Merge "Add libcgrouprc to ld.config.txt."
am: 210b56e9a8

Change-Id: I970388547469429bf3da64604c4141111387d37a
2019-06-12 08:29:09 -07:00
Jiyong Park
210b56e9a8 Merge "Add libcgrouprc to ld.config.txt." 2019-06-12 15:15:51 +00:00
Josh Gao
b965eea9c6 Merge "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND."
am: cb2352a75d

Change-Id: I4245392aabc9fce64ef79c54f00f7c9d35c36958
2019-06-12 07:47:10 -07:00
Treehugger Robot
cb2352a75d Merge "adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND." 2019-06-12 14:34:14 +00:00
Suren Baghdasaryan
9a7ef4957e Merge "race condition in libprocessgroup"
am: aba081c119

Change-Id: If21a1b91bd5fe2b45bf95a69e5b8f479b01a396b
2019-06-12 07:01:31 -07:00
Suren Baghdasaryan
aba081c119 Merge "race condition in libprocessgroup" 2019-06-12 13:55:33 +00:00
Josh Gao
2b668d3906 adbd: don't close ep0 until we receive FUNCTIONFS_UNBIND.
Rework the functionfs logic to avoid rebinding the USB interface
repeatedly.

Bug: http://b/133132986
Test: treehugger
Change-Id: I7f75874efd197764d40b66800a117ff4726d793b
2019-06-11 20:33:16 -07:00
Min Yun
d695733df9 Add libcgrouprc to ld.config.txt.
- In GSI, media.extractor has follow dependency.
media.extractor -> libmpeg2extractor (media ns) ->
libprocessgroup (media ns) -> libcgrouprc (default ns).
If libcgroupsrc can't link from libmpeg2extractor, media.extractor is crashed.

Test: media.extractor didn't die.
Bug: 134981805
Change-Id: I7d3e7e6477708a505b87a884e05cd719f5a3d496
2019-06-12 11:19:59 +09:00
Jooyung Han
29949c089c Merge "fix: passing ResultError to Error thru operator<<"
am: 3fcd831a6d

Change-Id: I2586d9a4fa94ba17f0e7c484b7baf09f450c3f56
2019-06-11 14:20:57 -07:00
Treehugger Robot
3fcd831a6d Merge "fix: passing ResultError to Error thru operator<<" 2019-06-11 21:12:32 +00:00
David Anderson
bef32b6273 Merge "liblp: Add helpers for finding partitions and partition sizes."
am: e53417a8ee

Change-Id: I75d89d59e1e997d0adca0af985b4010c35c7960a
2019-06-11 13:42:02 -07:00
David Anderson
e53417a8ee Merge "liblp: Add helpers for finding partitions and partition sizes." 2019-06-11 20:27:53 +00:00
mtk16036
53f79e6861 race condition in libprocessgroup
while enable fdsan (file descriptor sanitizer),
fdsan report use-after-close error after boot complete (sedom).

Because, in SetCgroupAction::EnableResourceCaching() currently has a data race against all the
use fd_ functions like SetCgroupAction::ExecuteForProcess(uid_t uid, pid_t pid) etc.

ThreadA                                     | ThreadB
-------------------------------------------------------------------------------------------------
in SetCgroupAction::EnableResourceCaching() | in SetCgroupAction::ExecuteForProcess(...)
-------------------------------------------------------------------------------------------------
                                            | in SetCgroupAction::AddTidToCgroup(int tid, int fd)
-------------------------------------------------------------------------------------------------
fd_ = std::move(fd); /*modified fd_ value*/ |
-------------------------------------------------------------------------------------------------
                                            | write(fd)  /* crash here, fd is closed by ThreadA*/
-------------------------------------------------------------------------------------------------

So, add mutex lock to protect fd_ data race.

Bug: 134120826
Test: auto test, run the adb reboot test 100 times and no fdsan error report on libprocessgroup
Change-Id: Iccf2f705e030f79324f1164509e715dc5be825de
2019-06-11 10:52:25 -07:00
Jaegeuk Kim
dfac7fbe05 Merge "fs_mgr: run fsck.f2fs with -f option when full mount fails"
am: 1d7f3b4f4e

Change-Id: I3bcbcfec3050448a4f6bafaee39525879eace0c9
2019-06-11 10:11:57 -07:00
Jaegeuk Kim
1d7f3b4f4e Merge "fs_mgr: run fsck.f2fs with -f option when full mount fails" 2019-06-11 16:59:48 +00:00
Christopher Ferris
ca776542ea Merge "Set elf_start_offset for invalid elf maps."
am: 45a88faa7a

Change-Id: I0a1d1f70e8c823d24655cc09ac3a8cce7481df03
2019-06-11 09:27:18 -07:00
Christopher Ferris
45a88faa7a Merge "Set elf_start_offset for invalid elf maps." 2019-06-11 16:17:59 +00:00
Jiyong Park
116f5933de Merge "Read *.rc files from flattened APEX"
am: b3093ff21a

Change-Id: I0ffd89a0f5948f083d310a5b5269be9e4ac22ec1
2019-06-11 05:21:13 -07:00
Treehugger Robot
b3093ff21a Merge "Read *.rc files from flattened APEX" 2019-06-11 12:11:11 +00:00
Jooyung Han
df7d32753e fix: passing ResultError to Error thru operator<<
It is typical to pass error to callers like following;

    if (!result) {
      return Error() << result.error();
    }

To transfer errno(or ResultError#code()), Error defines a specialization
operator<<(const ResultError&).

This change fixes so that ResultError is properly handled

Bug: 132145659
Test: atest libbase_test
Change-Id: Ib35457da2d4b923d8e652c54ac510a75546cf918
2019-06-11 13:38:01 +09:00
Josh Gao
c62f2aca24 Merge "adb: avoid freeing argv entries on Windows."
am: 5b63cff411

Change-Id: Ib2ea1eaa90b7c24829286361bdfc8909a8c7b059
2019-06-10 18:57:01 -07:00
Josh Gao
5b63cff411 Merge "adb: avoid freeing argv entries on Windows." 2019-06-11 01:43:52 +00:00
Christopher Ferris
d49499d5c9 Set elf_start_offset for invalid elf maps.
Add new unit tests to cover this case.

Bug: 133495043

Test: New unit tests pass.
Change-Id: I9ded5732c3c40197ebfddee3dcacc4aa07541ac0
2019-06-10 18:39:38 -07:00
Sahitya Tummala
5928e4f8d3 fs_mgr: run fsck.f2fs with -f option when full mount fails
There are cases where fsck.f2fs -f helps to recover from
corruption and thus helps to mount f2fs successfully.

CRs-Fixed: 2458080
Change-Id: I8d91835e464ef86e6ad4f96b7ac83f9f3d57c14f
2019-06-11 01:36:21 +00:00
Tom Cherry
ae3d9e6b41 Merge "Remove Result<Success> in favor of Result<void>"
am: bc1ccde87c

Change-Id: I66e46d23ff25ba5f3dbfcad7aad181843d79fa21
2019-06-10 18:08:42 -07:00
Tom Cherry
3099fbfe77 Merge "init: replace Result<Success> with Result<void>"
am: 31a0ab8fe1

Change-Id: I1cfadfb3134576b758087c02c83697684784d4ff
2019-06-10 18:07:58 -07:00
Tom Cherry
bc1ccde87c Merge "Remove Result<Success> in favor of Result<void>" 2019-06-11 00:38:30 +00:00
Tom Cherry
31a0ab8fe1 Merge "init: replace Result<Success> with Result<void>" 2019-06-11 00:27:22 +00:00
Jaegeuk Kim
1d8e339ba9 Merge "fs_mgr: support -o sync"
am: 2184ecb8ad

Change-Id: I26bf22694ffd6680ddd3278db25fadf7d65bf241
2019-06-10 14:55:19 -07:00
Treehugger Robot
2184ecb8ad Merge "fs_mgr: support -o sync" 2019-06-10 21:40:23 +00:00
Josh Gao
e72c44b24a adb: avoid freeing argv entries on Windows.
We assign string literals directly to argv[0], which leads to fun
explosions when we attempt to free  when the runtime can detect that
a bad free happened, which seems to happen reliably with lld.

Bug: http://b/110800681
Test: `adb shell true` on windows
Change-Id: Ica81e472c31686d80b58c41ff6d2b825baef06fb
2019-06-10 12:54:14 -07:00
Tom Cherry
91e6f888d7 Remove Result<Success> in favor of Result<void>
Result<void> is the correct way to do this.

Bug: 132145659
Test: libbase and init unit tests
Change-Id: I9c2e16cee6657a1895f215016df41a8b290383c7
2019-06-10 12:53:15 -07:00
Tom Cherry
bbcbc2ffb3 init: replace Result<Success> with Result<void>
Now that Result<T> is actually expected<T, ...>, and the expected
proposal states expected<void, ...> as the way to indicate an expected
object that returns either successfully with no object or an error,
let's move init's Result<Success> to the preferred Result<void>.

Bug: 132145659
Test: boot, init unit tests
Change-Id: Ib2f98396d8e6e274f95a496fcdfd8341f77585ee
2019-06-10 12:39:18 -07:00
David Anderson
064a9a6331 Merge "liblp: Replace some |const char*| inputs with std::string."
am: 7a6ce0623f

Change-Id: Ia7aa2f18908468f790bc788998f4c1ed8ed38617
2019-06-10 12:19:34 -07:00
David Anderson
7a6ce0623f Merge "liblp: Replace some |const char*| inputs with std::string." 2019-06-10 19:09:56 +00:00
Jaegeuk Kim
5ffa970489 fs_mgr: support -o sync
Bug: 134172577
Change-Id: I1ad8811b07657727d8227d3668f58b0fbc7e7609
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2019-06-10 10:57:52 -07:00
Neil Fuller
91f35c08cd Merge "Switch tzdatacheck to comparing tzdata module file"
am: e59703319f

Change-Id: I7cec6c1225b03f6a047c5d9c8fac774490f1754e
2019-06-10 10:57:14 -07:00
Neil Fuller
e59703319f Merge "Switch tzdatacheck to comparing tzdata module file" 2019-06-10 17:40:51 +00:00
Tom Cherry
1e48f513b2 Merge "logd: handle uidToName() directly"
am: caa95d551d

Change-Id: Ia863da24fb5ffa34bfec6f46ec24e15dd127e3b9
2019-06-10 08:42:41 -07:00
Tom Cherry
26ad5bf069 Merge "base: Add MmapFile as a synonym for MappedFile"
am: 727762ef07

Change-Id: I3c28b1afb8ed191a892149f2c2c100502abf4c2c
2019-06-10 08:42:22 -07:00
Tom Cherry
caa95d551d Merge "logd: handle uidToName() directly" 2019-06-10 15:27:13 +00:00
Tom Cherry
727762ef07 Merge "base: Add MmapFile as a synonym for MappedFile" 2019-06-10 15:26:13 +00:00
Neil Fuller
09bdb325a7 Switch tzdatacheck to comparing tzdata module file
The old "time zone updates via APK" feature installs time zone data
files in /data. tzdatacheck is run during boot to guard against an
OTA leaving the data in /data older, or in a different format, than the
files that exist elsewhere on device. If such files existed the system
could use old versions of tzdb (and related) data or even end up
unstable.

Soon, the time zone data mainline module will be made "functionally
mandatory" by the removal of most time zone data files from the
runtime module APEX, i.e. the time zone data module cannot be absent,
and the runtime module won't have files to compare against.

This change modifies the command line args for tzdatacheck to reference
the contents of time zone data module instead of the runtime module.

Bug: 132168458
Test: Build / boot / inspect logcat
Change-Id: Iac8023b7cbb72213df344d603c121caa867a196f
2019-06-10 11:02:44 +00:00
Jiyong Park
d2217b5167 Read *.rc files from flattened APEX
This change fixes a bug that *.rc files in APEXes are not read when the
APEXes are flattened. This was because init used "/apex/*@*/etc/*.rc"
glob pattern to find the files, which gives 0 result with flattened
APEXes; with flattend APEXes /system/apex is just bind-mounted to /apex,
and therefore, the name@version directories don't exist.

Fixing the issue by globing /apex/*/etc/*.rc and filter-out the paths
with @ to avoid double parsing the *.rc files in case of non-flattend
APEXes.

Bug: 134067086
Test: revert I75ec6b69cca1cef071b50fac9a4cf8b8ceddb142
build sdk_gphone_x86_64 and record a video in the camera app.
The recording works. `ps -A | grep media.swcodec` shows media.swcodec process.
`atest CtsStatsdHostTestCases:android.cts.statsd.atom.UidAtomTests#testAudioState` passes
Test: build sdk_phone_x86_64 and do the same.

Change-Id: I00af1910a8e8a330addc4c6903e5f3695aeb6865
2019-06-10 13:06:39 +09:00
Tom Cherry
383e1418ff base: Add MmapFile as a synonym for MappedFile
I was looking for 'MmapFile' earlier and couldn't find it.  After
being pointed to it, we thought that adding this synonym would help
others trying to find this file.

Test: n/a
Change-Id: I7fbfd8e090f21183a5de3603a76f884562b99c4a
2019-06-07 13:05:22 -07:00
Elliott Hughes
dc0d9ecd92 Merge "liblog: fix benchmark build after google-benchmark upgrade."
am: 8958d7a127

Change-Id: I5a2951191fc8f57f68a56aa27a734b87cbe32af5
2019-06-07 12:02:16 -07:00
Treehugger Robot
8958d7a127 Merge "liblog: fix benchmark build after google-benchmark upgrade." 2019-06-07 18:45:29 +00:00
Tom Cherry
36f5399341 logd: handle uidToName() directly
uidToName() originally used a separate worker thread with additional
group permissions.  Threads are not security boundaries however, so
these group permissions are removed in a previous change.

This change handles the lookup for uidToName() directly without using
a separate thread.

Test: boot CF, logd unit tests
Change-Id: If245388bc221bc77102a0bbcee82c8f42b140760
2019-06-07 11:39:24 -07:00
David Anderson
196d2ba7b9 liblp: Add helpers for finding partitions and partition sizes.
These tend to get manually, so let's promote to actual helpers.

Bug: 134536978
Test: liblp_test gtest
Change-Id: Ifb79c8d6f247cc3f9635bf6adfd1c99907340002
2019-06-07 11:09:28 -07:00
David Anderson
1e05e55820 liblp: Replace some |const char*| inputs with std::string.
Bug: 134536978
Test: builds
Change-Id: I23dba6747be334f42506f969d6d52b293c69f0bd
2019-06-07 11:09:26 -07:00