Commit graph

34831 commits

Author SHA1 Message Date
Luis Hector Chavez
dd79958ecb Merge "init: Read previous state of securebits before modifying" am: c10e14110a am: 19f32317b3
am: 9dabbbaa6a

Change-Id: Id5cdc260c7f6800e493c0f3b4e0da08ddca34b63
2017-07-01 00:39:42 +00:00
Luis Hector Chavez
9dabbbaa6a Merge "init: Read previous state of securebits before modifying" am: c10e14110a
am: 19f32317b3

Change-Id: I87084032373a71b507ed0604c7ff38ec076fc74a
2017-07-01 00:35:11 +00:00
Luis Hector Chavez
19f32317b3 Merge "init: Read previous state of securebits before modifying"
am: c10e14110a

Change-Id: I0a9b2dc97ebbc449288de2ce3e2745a1f60a4372
2017-07-01 00:30:42 +00:00
Treehugger Robot
c10e14110a Merge "init: Read previous state of securebits before modifying" 2017-07-01 00:20:50 +00:00
Luis Hector Chavez
f5965519d1 init: Read previous state of securebits before modifying
When Android is running in a container, some of the securebits might be
locked, which makes prctl(PR_SET_SECUREBITS) fail.

This change gets the previous state of the process' securebits and adds
the desired bits.

Bug: 62388055
Test: aosp_bullhead-eng boots
Test: If init has non-zero securebits, it can also boot
Change-Id: Ie03bf2538f9dca40955bc58314d269246f5731bd
2017-06-30 14:42:46 -07:00
Steven Moreland
f73510e78d Merge "logd + liblogd to Android.bp" am: c997cd64dc am: f7a68f02d5
am: 25982a424b

Change-Id: I08172e23da0b58054380754b6db7c7e62069c2d9
2017-06-30 19:49:16 +00:00
Steven Moreland
25982a424b Merge "logd + liblogd to Android.bp" am: c997cd64dc
am: f7a68f02d5

Change-Id: I0b117103fb0bcf0b187107d10d04ceaa6a8ee499
2017-06-30 19:45:07 +00:00
Steven Moreland
f7a68f02d5 Merge "logd + liblogd to Android.bp"
am: c997cd64dc

Change-Id: I3cdc65fec1cd8487da86621a3381692ccd641756
2017-06-30 19:40:45 +00:00
Treehugger Robot
c997cd64dc Merge "logd + liblogd to Android.bp" 2017-06-30 19:32:41 +00:00
Tianjie Xu
bf6f0eeb10 Merge changes Ie89f709b,Ibf543a7d,I1d8092a1 am: 67897d47ce -s ours am: 14f913817f -s ours
am: 5f7bb2b1df  -s ours

Change-Id: I88ffdc026b294f511b43bfe7c9c36d18bee8d0f9
2017-06-30 15:55:13 +00:00
Tianjie Xu
5f7bb2b1df Merge changes Ie89f709b,Ibf543a7d,I1d8092a1 am: 67897d47ce -s ours
am: 14f913817f  -s ours

Change-Id: I74f5fd6117de8b9aab9913cba352183348d56cd5
2017-06-30 15:50:42 +00:00
Tianjie Xu
14f913817f Merge changes Ie89f709b,Ibf543a7d,I1d8092a1
am: 67897d47ce  -s ours

Change-Id: I92f71f1f89759f5f670577b87650141ebf859efc
2017-06-30 15:46:13 +00:00
Treehugger Robot
67897d47ce Merge changes Ie89f709b,Ibf543a7d,I1d8092a1
* changes:
  Fix out of bound read in libziparchive
  Check filename memory bound when parsing ziparchive
  Fix out of bound access in libziparchive
2017-06-30 15:38:13 +00:00
Tianjie Xu
0fda1cf633 Fix out of bound read in libziparchive
We should check the boundary of central directory before checking its
signature. Swap the order of these two checks.

Bug: 36392138
Test: libziparchive doesn't read the signature after boundary check fails.
Merged-In: Ie89f709bb2d1ccb647116fb7ccb1e23c943e5ab8
Change-Id: Ie89f709bb2d1ccb647116fb7ccb1e23c943e5ab8
(cherry picked from commit 74464a1361)
2017-06-30 17:19:56 +09:00
Tianjie Xu
9e020e2d11 Check filename memory bound when parsing ziparchive
Add a check to ensure the filename boundary doesn't exceed the mapped
memory region. Also add the corresponding unit test.

Bug: 28802225
Test: New unit test passes.
Merged-In: Ibf543a7da3d7898952e9eb332c84cdfc67cf5aa4
Change-Id: Ibf543a7da3d7898952e9eb332c84cdfc67cf5aa4
(cherry picked from commit bcc4431f24)
2017-06-30 17:19:28 +09:00
Tianjie Xu
fba1a36fd9 Fix out of bound access in libziparchive
The boundary check of an invalid EOCD record may succeed due to the
overflow of uint32_t. Fix the check and add a unit test.

Test: Open the crash.apk and libziparchive reports the offset error as expected.

Bug: 31251826
Merged-In: I1d8092a19b73886a671bc9d291cfc27d65e3d236
Change-Id: I1d8092a19b73886a671bc9d291cfc27d65e3d236
(cherry picked from commit ae8180c06d)
2017-06-30 17:18:31 +09:00
Colin Cross
33c6549f73 Merge "Fix ScopedSignalHandler" am: 7dbf1a187e am: 1deafe164b
am: 9a29d20486

Change-Id: I0d6f957a8cd0f6feeb2f2ccc89b858bdfa8190cd
2017-06-30 06:59:07 +00:00
Colin Cross
9a29d20486 Merge "Fix ScopedSignalHandler" am: 7dbf1a187e
am: 1deafe164b

Change-Id: Ie40e77a28100eddb12a85cc8bcd31f169f317805
2017-06-30 06:54:38 +00:00
Colin Cross
1deafe164b Merge "Fix ScopedSignalHandler"
am: 7dbf1a187e

Change-Id: Ic85a20682ecaa109d03827a694efd751e0fb9418
2017-06-30 06:50:38 +00:00
Treehugger Robot
7dbf1a187e Merge "Fix ScopedSignalHandler" 2017-06-30 06:44:40 +00:00
Luis Hector Chavez
1b42dbf22c Merge changes I0a95f87a,I36b22986 am: a703202093 am: 835d259e7a
am: 40e88b22f2

Change-Id: I04e3d91d34d2c50d15ab2357db175b1f69796af1
2017-06-30 04:33:30 +00:00
Luis Hector Chavez
40e88b22f2 Merge changes I0a95f87a,I36b22986 am: a703202093
am: 835d259e7a

Change-Id: I329bddc9b470da86d07bde3ce3ab8a69c37a38e2
2017-06-30 04:29:28 +00:00
Luis Hector Chavez
835d259e7a Merge changes I0a95f87a,I36b22986
am: a703202093

Change-Id: Id0ab2a68ade41db6c1327d9b96489bf0f9a223cb
2017-06-30 04:24:32 +00:00
Treehugger Robot
a703202093 Merge changes I0a95f87a,I36b22986
* changes:
  init: Use ScopedCaps for cap_init()
  init: Reland "Terminate gracefully when CAP_SYS_BOOT is absent"
2017-06-30 04:19:09 +00:00
Robert Benea
888d9e198b Merge "Use mem cgroups in libprocessgroup if they're available" am: d3afc124b6 am: 46706e6824
am: 74c02e7b58

Change-Id: Iba2c643286063a9ffa22f3917f8acbcca1d77ef3
2017-06-30 02:41:24 +00:00
Robert Benea
74c02e7b58 Merge "Use mem cgroups in libprocessgroup if they're available" am: d3afc124b6
am: 46706e6824

Change-Id: I88b0928e78f4faf6eebfe94ef7c1e528dc543327
2017-06-30 02:36:53 +00:00
Robert Benea
46706e6824 Merge "Use mem cgroups in libprocessgroup if they're available"
am: d3afc124b6

Change-Id: Idd72671eb144343a73a02bfbde8603265ca78650
2017-06-30 02:32:24 +00:00
Robert Benea
d3afc124b6 Merge "Use mem cgroups in libprocessgroup if they're available" 2017-06-30 02:26:30 +00:00
Colin Cross
eac4ecc34f Fix ScopedSignalHandler
I4ae2d82fdfdd58cf8ef1dfb6c401cef4ba9d3e88 broke memunreachable_test
by replacing signal_ with signal.

Test: memunreachable_test
Change-Id: I8148321e3a94530867106708a33b5b63ed867380
2017-06-29 17:13:35 -07:00
Elliott Hughes
f4b01412f1 Merge "Remove more documentation for obsolete board configuration." am: 73a6512bab am: 09181f3dd9
am: 94d5235c25

Change-Id: I128a89de4783b152f4129d0c5f16e766ed349ea2
2017-06-30 00:07:45 +00:00
Elliott Hughes
94d5235c25 Merge "Remove more documentation for obsolete board configuration." am: 73a6512bab
am: 09181f3dd9

Change-Id: I95e37353d84e69df12a2b5ef36b02b771cbbf0eb
2017-06-30 00:03:45 +00:00
Elliott Hughes
09181f3dd9 Merge "Remove more documentation for obsolete board configuration."
am: 73a6512bab

Change-Id: I964c133a654efbc3d40bbebc7247863455e8cb54
2017-06-29 23:59:43 +00:00
Elliott Hughes
73a6512bab Merge "Remove more documentation for obsolete board configuration." 2017-06-29 23:50:37 +00:00
Robert Benea
32375c2328 Use mem cgroups in libprocessgroup if they're available
Use mem cgroups if the kernel is built with CONFIG_MEMCG=y,
additionally add system group.

test: verified on both kernel with/without memcg enabled
Change-Id: Ib9d1c8e3c797e75f160e0e92edf3f11c9d8e9f17
2017-06-29 23:49:00 +00:00
Christopher Ferris
2b49c8ceb7 Merge "Remove assert, use CHECK instead." am: 5d6d932a60 am: a520b8baa8
am: fc04d39ab5

Change-Id: Ifae83c8dd425b554b948b7b25edffc9e8981f2bf
2017-06-29 23:01:25 +00:00
Christopher Ferris
fc04d39ab5 Merge "Remove assert, use CHECK instead." am: 5d6d932a60
am: a520b8baa8

Change-Id: I5ed89883d2bfaddc7e26c16abcb8a111776ee62b
2017-06-29 22:57:07 +00:00
Christopher Ferris
a520b8baa8 Merge "Remove assert, use CHECK instead."
am: 5d6d932a60

Change-Id: I84ca9a5e4a77c44a336245286c1d40d7fd4de003
2017-06-29 22:53:09 +00:00
Christopher Ferris
5d6d932a60 Merge "Remove assert, use CHECK instead." 2017-06-29 22:49:38 +00:00
Todd Poynor
4ec2a299fa Merge "healthd: notify listeners using local copy of list, drop lock" am: e29a6cda31 am: 51741d2f50
am: 93a45c0b6c

Change-Id: Iefecfe113c997f946488dc1db83feb4a12cb3ba6
2017-06-29 22:37:38 +00:00
Todd Poynor
93a45c0b6c Merge "healthd: notify listeners using local copy of list, drop lock" am: e29a6cda31
am: 51741d2f50

Change-Id: Iac44a0aaa44cb91666df0c24226457b6db4048b6
2017-06-29 22:33:36 +00:00
Todd Poynor
51741d2f50 Merge "healthd: notify listeners using local copy of list, drop lock"
am: e29a6cda31

Change-Id: I94c6b076148c65e82ef13fc75b4be15b3e930901
2017-06-29 22:29:36 +00:00
Treehugger Robot
e29a6cda31 Merge "healthd: notify listeners using local copy of list, drop lock" 2017-06-29 22:26:01 +00:00
Todd Poynor
8bd30b3cf3 healthd: notify listeners using local copy of list, drop lock
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting).  The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded.  The binder behavior is considered a bug and may change in
the future.  For now, work around this in healthd.

Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.

Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
2017-06-29 22:25:40 +00:00
Luis Hector Chavez
7bb360230d init: Use ScopedCaps for cap_init()
This change homogenizes the use of std::unique_ptr for storing
capabilities in system/core/.

Bug: None
Test: m
Change-Id: I0a95f87a27b0261e9d321841d5140fc000473293
2017-06-29 14:41:23 -07:00
Luis Hector Chavez
519e5f0592 init: Reland "Terminate gracefully when CAP_SYS_BOOT is absent"
This change makes it possible for Android running in a container to
terminate cleanly instead of calling abort() when requested to shut
down.

Bug: 62388055
Test: `adb reboot` on bullhead causes no kernel panics
Test: `adb reboot` on a system without CAP_SYS_BOOT makes init terminate
       nicely

Change-Id: I36b2298610f5b4a2bf8b05103d04804883df2c88
2017-06-29 14:41:23 -07:00
Josh Gao
b6e271d219 Revert "adb: turn on libusb by default."
am: aabd9a09b5

Change-Id: I704426213b4470cdd35513abe6fd5fb7a592d973
2017-06-29 20:44:57 +00:00
Josh Gao
aabd9a09b5 Revert "adb: turn on libusb by default."
This reverts commit f2f0b31850.

libusb seems to be causing flakiness on some machines. Disable it for
now.

Bug: http://b/62962248
Test: python test_device.py (with DeviceOfflineTest commented out)
Change-Id: Ia9de78ab772c22574cf5ca7facb78f22af6d7a71
(cherry picked from commit 969110ca4a)
2017-06-29 11:22:55 -07:00
Christopher Ferris
9416703f5b Remove assert, use CHECK instead.
- Use the CHECK macro everywhere that assert was used.
- Remove the _debug version of the tests and leave the CHECK macro so
  it's always checking in the code.

Bug: 23762183

Test: Ran unit tests.
Change-Id: Ie705eedae393d0e95bb9d99f852687a11881aef1
2017-06-29 10:29:43 -07:00
Steven Moreland
fca20d8aa1 logd + liblogd to Android.bp
Test: boot, adb logcat produces output
Change-Id: I89e7f9a19e139d3f5a71040b1555d01913946b85
2017-06-29 09:29:36 -07:00
Elliott Hughes
5dc7736f60 Remove more documentation for obsolete board configuration.
Bug: N/A
Test: builds
Change-Id: I0a4ea974a81aadba1a554072ceff9f243a70be0d
2017-06-29 08:52:49 -07:00