Commit Graph

39227 Commits

Author SHA1 Message Date
Josh Gao 5504477722 Merge "debuggerd seccomp: explain why we define PROT_READ/WRITE."
am: 665e4c1537

Change-Id: I3762171a451d169d273a4affa3bf3c6eee7a3b3c
2018-02-19 09:49:45 +00:00
Treehugger Robot 665e4c1537 Merge "debuggerd seccomp: explain why we define PROT_READ/WRITE." 2018-02-19 09:43:22 +00:00
Justin Yun 158208cde0 Merge "Define PROT_READ and PROT_WRITE when generating the policy files"
am: a1721a5043

Change-Id: Ibb4459bac1136ce9c54b7a109bb7b7dc72986563
2018-02-19 09:39:05 +00:00
Treehugger Robot a1721a5043 Merge "Define PROT_READ and PROT_WRITE when generating the policy files" 2018-02-19 09:33:33 +00:00
George Burgess IV cb2449f851 Fix a memory leak
If create_service_thread fails, we'll leak `arg`.

This fixes a static analyzer complaint:
system/core/adb/services.cpp:298:13: warning: Potential leak of memory
pointed to by 'arg'

Bug: None
Test: Reran the static analyzer. No more complaints about this leak.
Change-Id: I5aec7fd78f2cc775b650501b02bdf0039d1647ca
2018-02-19 01:05:56 -08:00
Josh Gao edd28f6ede debuggerd seccomp: explain why we define PROT_READ/WRITE.
Add a comment explaining why we define PROT_READ/PROT_WRITE, even
though a current libminijail supports both cosntants.

Bug: http://b/73273658
Test: treehugger
Change-Id: I51c1be1b1b569e94dbc9045a90bc28221b7dc9c7
2018-02-18 23:50:19 -08:00
Justin Yun 40ecb9abf2 Define PROT_READ and PROT_WRITE when generating the policy files
When generating crash_dump.*.policy, replace PROT_READ and PROT_WRITE
to numeric constants to make the policy backward compatible with old
libminijail.so.

Bug: 73273658
Test: use the new policy in OMR1 devices
Change-Id: I936a733340ad4df8aef6562c03eb10c29ffdada2
2018-02-19 10:42:42 +09:00
Christopher Ferris e89745202c Merge "Modify elf cache to handle elf_offsets properly."
am: 277a95bfef

Change-Id: I71c15df8d527548610cc15484f7c382e85b54552
2018-02-17 03:49:06 +00:00
Christopher Tate e68fa81351 Merge "Fix darwin build"
am: 8c0c1ba989

Change-Id: I8acb6a80f4ab5458f01fb6196203c4c664438934
2018-02-17 03:46:53 +00:00
Christopher Ferris 277a95bfef Merge "Modify elf cache to handle elf_offsets properly." 2018-02-17 02:00:31 +00:00
Elliott Hughes dc699a269f bpfmt.
Bug: N/A
Test: builds
Change-Id: I89ad00e1c4c7e0767bc80a7ac7935a4d55e090ac
2018-02-16 17:58:14 -08:00
Treehugger Robot 8c0c1ba989 Merge "Fix darwin build" 2018-02-17 01:45:37 +00:00
Christopher Tate 6983112f59 Fix darwin build
Darwin needs libbase too.

Test: 'm'
Change-Id: I9d50face92b7d5a4399dbcebd39d4062477b3a2c
2018-02-16 14:54:36 -08:00
Christopher Ferris d9575b668b Modify elf cache to handle elf_offsets properly.
Bug: 73498823

Test: All unit tests pass.
Test: Simpleperf run that previously failed, passes now.
Change-Id: Iff3a1f2f641a46ab9a0326579af3649f0c76fc65
2018-02-16 14:52:38 -08:00
Christopher Ferris 299aa7a646 Merge "Fix soname reading code."
am: 76eda07ff6

Change-Id: I659a84ac44940ac38a8d31f9a5c3cb102435da07
2018-02-16 17:31:25 +00:00
Christopher Ferris 76eda07ff6 Merge "Fix soname reading code." 2018-02-16 17:25:42 +00:00
Elliott Hughes 6737861501 Merge "Include the map name when dumping memory around a register."
am: ffe12c600f

Change-Id: Ide52b02276d39e9c74baf0ab82fc47f144910455
2018-02-16 17:08:38 +00:00
Elliott Hughes ffe12c600f Merge "Include the map name when dumping memory around a register." 2018-02-16 16:54:34 +00:00
David Srbecky 4015ef411a Adjust DEX file reading to follow layout changes in ART.
I have changed the root DEX debug descriptor in ART to more
closely follow the JIT debug descriptor. Add the appropriate
offsets to correctly fetch the linked list head for DEX files.

Test: testrunner.py -t 137
Test: libunwindstack_test
Change-Id: I90402befc88fec42658f7330d51ee79756a7f872
2018-02-16 14:54:49 +00:00
Christopher Ferris beae42bc7f Fix soname reading code.
The dynamic section contained an address, not an offset into the elf
file to indicate where the soname exists. Changed to use the strtab
entries in the section headers to map this address to the actual offset.

Refactor the soname test a bit to make it easier to verify the code.

Bug: 73499044

Test: Passes new unit tests.
Test: Ran unwind_info on the failing shared elf and verified the soinfo
Test: is correct.
Change-Id: I16ba148389bcb9aadd3566fb442dac27f89fe894
2018-02-15 17:57:13 -08:00
Paul Crowley cc3e825100 Merge "If enablefilecrypto or init_user0 fails, reboot into recovery."
am: 851803d3cf

Change-Id: I67b0984f6eb77d1f2f3cedc02cfb68941a2c0475
2018-02-16 00:49:36 +00:00
Tom Cherry 44fd091bee Merge changes Iea2d97fb,I08fa3905,Idd5b923e
am: e1ae2ff9e4

Change-Id: Ia21b586491e053c439878c661e056bfd6754f430
2018-02-16 00:45:37 +00:00
Elliott Hughes e1415a5c3b Include the map name when dumping memory around a register.
Bug: http://b/19590178
Test: ran tests, ran crasher
Change-Id: Ib9afa34c860d8732ef1943eb4decd0b7c8fb55fd
2018-02-15 16:28:50 -08:00
Treehugger Robot 851803d3cf Merge "If enablefilecrypto or init_user0 fails, reboot into recovery." 2018-02-15 21:16:42 +00:00
Paul Crowley 959b055535 If enablefilecrypto or init_user0 fails, reboot into recovery.
Test: Roll back PLATFORM_SECURITY_PATCH, ensure recovery dialog is seen
Bug: 70487538
Change-Id: Iceb6af3f9d6aea6bc646dbb4b5d29dffcb284736
2018-02-15 10:23:52 -08:00
David Sehr 868eac2f94 Merge "Move libdexfile out of runtime"
am: a99ff49ab0

Change-Id: I2c1fc649d7bef7c645e61f6459e77de1257d7b12
2018-02-15 16:46:40 +00:00
Tom Cherry e1ae2ff9e4 Merge changes Iea2d97fb,I08fa3905,Idd5b923e
* changes:
  Move all Action parsing into ActionParser
  Move ActionManager to its own file
  Move ActionParser to its own file
2018-02-15 16:32:52 +00:00
David Sehr a99ff49ab0 Merge "Move libdexfile out of runtime" 2018-02-15 16:21:21 +00:00
Luis Hector Chavez 53274d67ff Merge "init.rc: Add nodev,noexec,nosuid to /config"
am: 7238eca684

Change-Id: I72e4b379f2a4fb6f5dadb32410a1f87c658b4ec1
2018-02-15 03:10:29 +00:00
Treehugger Robot 7238eca684 Merge "init.rc: Add nodev,noexec,nosuid to /config" 2018-02-15 03:01:33 +00:00
Tom Cherry 9cbf57048c Move all Action parsing into ActionParser
Bug: 36970783
Test: Build
Change-Id: Iea2d97fb45c3e88bc83fb72d6fa67049be42cfa9
2018-02-14 16:37:17 -08:00
Tom Cherry 7fd3bc27ec Move ActionManager to its own file
Bug: 36970783
Test: build
Change-Id: I08fa39052236b462249f79de1d02bf02bdbf4c84
2018-02-14 16:37:09 -08:00
Luis Hector Chavez 0802d45683 Merge "init.rc: Mount /mnt with nodev,nosuid,noexec"
am: 6698482ca4

Change-Id: I525302301e2812db8b087995c9e4b23d2e0cc966
2018-02-15 00:31:11 +00:00
Treehugger Robot 6698482ca4 Merge "init.rc: Mount /mnt with nodev,nosuid,noexec" 2018-02-15 00:20:12 +00:00
Steven Moreland 23da76e246 Merge "ion_test.c: Fix c/p error in arg parse."
am: f51886bbc4

Change-Id: I91864b299077d374eeccc128b571ee04ea130480
2018-02-14 23:35:44 +00:00
Luis Hector Chavez c37d85953e Merge "init.rc: Remount / with MS_REMOUNT|MS_BIND"
am: 008576080e

Change-Id: Ie48bb09b8f46ccdda809835fb29811fac8b44c6c
2018-02-14 23:34:58 +00:00
Treehugger Robot f51886bbc4 Merge "ion_test.c: Fix c/p error in arg parse." 2018-02-14 23:25:23 +00:00
Treehugger Robot 008576080e Merge "init.rc: Remount / with MS_REMOUNT|MS_BIND" 2018-02-14 23:24:01 +00:00
Robert Sesek 84e8a3811f Remove fs_config entries for webview_zygote.
This process is now spawned from the main app_process zygote, rather
than being its own binary launched by init.

Bug: 63749735
Test: m
Change-Id: I87e00197e1ce64d77b4c306fcd702c6ad778b236
2018-02-14 17:42:03 -05:00
yusukes b94bff1d64 Merge "Prevent WaitForProperty() from using ~100% of CPU time on 32bit builds"
am: 7c6b024241

Change-Id: I08851adfbb9a4fa01a65ca1af6a7c41d0643ca1d
2018-02-14 21:16:53 +00:00
Steven Moreland b81e185907 ion_test.c: Fix c/p error in arg parse.
Bug/Test: N/A

Change-Id: Iad1ac3f057ed153429780242e138cec58e8ee764
2018-02-14 13:12:22 -08:00
Luis Hector Chavez 8774945036 init.rc: Add nodev,noexec,nosuid to /config
This change adds some additional flags to the /config mount. This is to
reduce the number of mounts with unnecessary privileges.

Bug: 73255020
Test: aosp_sailfish still boots
Test: CtsAppSecurityHostTestCases {ExternalStorageHostTest,StorageHostTest}
Merged-In: If3409d917cdf76a67ebfb7c4035a3ae8fee6189f
Change-Id: If3409d917cdf76a67ebfb7c4035a3ae8fee6189f
2018-02-14 20:58:56 +00:00
Luis Hector Chavez 081aa0a303 init.rc: Mount /mnt with nodev,nosuid,noexec
This change adds some additional flags to /mnt. This is to reduce
the number of mounts with unnecessary flags.

Bug: 73255020
Test: aosp_sailfish still boots
Test: CtsAppSecurityHostTestCases {StorageHostTest,ExternalStorageHostTest}
Test: CtsOsTestCases StorageManagerTest
Test: find /mnt  | egrep -v '^/mnt/runtime/(default|read|write)/emulated' | \
      xargs ls -lZd  # Shows no character devices or executable files
Change-Id: I54739133119d9626ebeb2ef9a1c127f7a90fa098
2018-02-14 20:51:40 +00:00
Luis Hector Chavez 30780a7305 init.rc: Remount / with MS_REMOUNT|MS_BIND
Since we only want to change the ro flag on / (and leave all other mount
flags alone), this can also be achieved by passing MS_REMOUNT|MS_BIND,
even if the mount is not a bind-mount.

This aims to make running Android within a user namespace easier, since
remounts without the MS_BIND flag are forbidden.

Bug: 73255020
Test: aosp_sailfish still boots
Test: rootfs on / type rootfs (rw,seclabel)
      /dev/root on / type ext4 (ro,seclabel,relatime,data=ordered)
Change-Id: I2f89a8badfc467db47304c9355648e8fd8ad1272
2018-02-14 20:51:06 +00:00
Treehugger Robot 7c6b024241 Merge "Prevent WaitForProperty() from using ~100% of CPU time on 32bit builds" 2018-02-14 20:33:24 +00:00
yusukes d3b9404241 Prevent WaitForProperty() from using ~100% of CPU time on 32bit builds
Since 'struct timespec' members (time_t and long) are both 32bit on
32bit systems, and std::chrono::{seconds,nanoseconds}::rep are both
>32bit, timespec members assigned in DurationToTimeSpec() can have a
negative value, especially when WaitForProperty() is called with the
default timeout value which is std::chrono::milliseconds::max().

Regarding functionality, passing a negative value to
__system_property_wait() is okay because WaitForProperty() still
waits for the property value (so unit tests are passing), but while
WaitForProperty() does that, the function, to be more exact,
SystemProperties::Wait() in bionic/, consumes ~100% of CPU time. This
happens because SystemProperties::Wait() which implements
__system_property_wait() has a tight while-loop with a __futex_wait()
call, and the futex call immediately returns EINVAL when the timespec
passed in has a negative value.

With this CL, WaitForProperty() will never pass a negative timespec
to __system_property_wait(), and therefore the __futex_wait() call
in bionic works as expected without consuming too much CPU time even
on 32bit systems.

Bug: None
Test: libbase_test32 still passes
Test: strace no longer shows repeated EINVALs from __futex_wait
Change-Id: Id1834fac8cd2876b02dbe4479bf3d3eda2fa7da1
2018-02-14 10:07:54 -08:00
David Sehr 3a26c27252 Move libdexfile out of runtime
Move the files out of runtime, leaving unfortunate dependences still
there on runtime/base (for the moment).  Also separates the build logic
into two Android.bp files.

Bug: 22322814
Test: make -j 50 test-art-host
Change-Id: I54b06f035034e7564480cd5d4c33c4f62785682d
2018-02-14 17:42:59 +00:00
Alexey Kuzmin 0f71d5fe53 Merge "Add tracing tags to vibrator"
am: c415d00fbe

Change-Id: Ic9e871085ae05ba68590623dc20f9c94f05fe0ec
2018-02-14 16:16:19 +00:00
David Srbecky c3aabea0b1 Merge "Implement new DEX PC lookup scheme."
am: f1e55f7a99

Change-Id: I9e7161dbef33febe2b8eb4398ceee163815b7a8f
2018-02-14 16:15:14 +00:00
Treehugger Robot c415d00fbe Merge "Add tracing tags to vibrator" 2018-02-14 15:57:34 +00:00