Commit graph

14358 commits

Author SHA1 Message Date
Andres Morales
531e3e83c2 [gatekeeperd] verify a password after enrolling successfully
Bug: 20918106
Change-Id: Ia3cb6d1375d9ee2a6e543ee97d37b7c4f0459447
2015-06-02 10:43:21 -07:00
Andreas Gampe
e2452b4bf3 LibNativeBridge: Version 2
Add a callback function to retrieve "signal handler" from the bridge,
if the bridge wants it to be managed by the runtime. The signal handler
will be invoked after the runtime's own one, and before any other
chained handler.

Add a callback function to check compatibility of the bridge with the
library.

Add a function to expose the native bridge version. Add a test for this
function.

Bug: 20217701

(cherry picked from commit a6ac9ce98b)

Change-Id: Ic23a60b949f119c7d8b0e7cb27a61e6c16532a23
2015-05-31 16:58:24 -07:00
Jeff Brown
20432c237c Merge "Work around spurious epoll notifications." into mnc-dev 2015-05-30 00:43:10 +00:00
Jeff Brown
18a574f715 Work around spurious epoll notifications.
Sometimes it seems like we can get into a situation where we are
unable to remove an fd from the epoll set but it keeps sending us
events anyhow.  Defensively rebuild the epoll set in this case
to prevent us from spinning forever.

Bug: 21271428
Change-Id: I5607e565f2e12460d7113a1f62a70d38d334e271
2015-05-29 17:40:25 -07:00
Paul Lawrence
0a423d994a DO NOT MERGE Securely encrypt the master key
(chery-picked from commit 806d10be23)

Move all key management into vold
Reuse vold's existing key management through the crypto footer
to manage the device wide keys.

Use ro.crypto.type flag to determine crypto type, which prevents
any issues when running in block encrypted mode, as well as speeding
up boot in block or no encryption.

This is one of four changes to enable this functionality:
  https://android-review.googlesource.com/#/c/148586/
  https://android-review.googlesource.com/#/c/148604/
  https://android-review.googlesource.com/#/c/148606/
  https://android-review.googlesource.com/#/c/148607/

Bug: 18151196

Change-Id: I6a8a18f43ae837e330e2785bd26c2c306ae1816b
2015-05-29 17:39:16 +00:00
Vineeta Srivastava
0aab798312 Merge "fastboot: Add support for fastboot flashing commands" into mnc-dev 2015-05-28 23:54:41 +00:00
Jim Miller
53d181dcb4 Merge "Fix 64-bit build error" into mnc-dev 2015-05-28 23:10:16 +00:00
Jim Miller
c59a6819af Fix 64-bit build error
Fixes bug 21491366

Change-Id: Ifd45ed8a0c5188c5fa2be1a9dac45b97c339685a
2015-05-28 15:47:16 -07:00
Tao Bao
6484f3d1cb Merge "Change pre-recovery into two services" into mnc-dev 2015-05-28 21:48:16 +00:00
Badhri Jagan Sridharan
a873e1dc02 fastboot: Add support for fastboot flashing commands
Commands added:
fastboot flashing lock
      - Prevents flashing partitions
fastboot flashing unlock
      - Enable user to flashing partitions
fastboot flashing lock_critical
      - Prevents flashing bootloader related
        paritions
fastboot flashing unlock_critical
      - Enables user to flash bootloader
        related partitions
fastboot flashing get_unlock_ability
      - Query bootloader to check if device is
        locked.

(cherry picked from commit bf11095f92)
Change-Id: Id6db16ba32f7a2b1c3f041a76bd3bdf2d3ab471e
2015-05-28 19:15:27 +00:00
Christopher Ferris
0c3f1ae66b Refactor dump_memory function.
- Add dumping memory around registers for x86/x86_64.
- Add unit tests for new dump_memory function.
- Cleanup all of the machine.cpp files.
- Increase the high address check for 32 bit, and decrease the high
  address allowed for 64 bit slightly to match mips64.

Bug: 21206576
(cherry picked from commit e8bc77eb84)

Change-Id: I49ec237e30076a232f084da1072bf9aba15dc0cd
2015-05-28 11:45:34 -07:00
Than McIntosh
b37c45e90a Move perfprofd to late_start class.
Bug: http://b/19483574
Change-Id: I88649b50b95cbddb7d0671a5499232cbef156c48
(cherry picked from commit e8efd0d6bf)
2015-05-28 11:58:31 -04:00
Lorenzo Colitti
0983a6d54c Merge "Document the -g option to adb install." into mnc-dev 2015-05-28 03:34:46 +00:00
Lorenzo Colitti
0b3baac512 Document the -g option to adb install.
Change-Id: I012165df343c24953f1c1cfcdce379bf1b67c624
2015-05-28 12:03:44 +09:00
Adam Lesinski
7f5c818149 am 87b02f23: am 4e830641: am 1def25a2: Merge commit \'7ac60686\' into manualmerge
* commit '87b02f23c0996ab487ef15794bf862b3cd3e5137':
  Prevent integer overflow when allocating native_handle_t
2015-05-28 01:33:18 +00:00
Adam Lesinski
87b02f23c0 am 4e830641: am 1def25a2: Merge commit \'7ac60686\' into manualmerge
* commit '4e8306419073c93f07c7ac69955d990ffa315d96':
  Prevent integer overflow when allocating native_handle_t
2015-05-28 01:23:09 +00:00
Adam Lesinski
4e83064190 am 1def25a2: Merge commit \'7ac60686\' into manualmerge
* commit '1def25a210ca502a97020efb732775d5c2df2d9a':
  Prevent integer overflow when allocating native_handle_t
2015-05-28 01:03:55 +00:00
Adam Lesinski
1def25a210 Merge commit '7ac60686' into manualmerge
Change-Id: I671a57d906ca6826722fb892627d235b14b822eb
2015-05-27 17:09:14 -07:00
Adam Lesinski
7ac6068636 am 058ad0b6: am e8582d65: am 9bd7afc0: Prevent integer overflow when allocating native_handle_t
* commit '058ad0b6612457c54c7ad6e3b5d5a618d94ae966':
  Prevent integer overflow when allocating native_handle_t
2015-05-27 23:40:35 +00:00
Adam Lesinski
058ad0b661 am e8582d65: am 9bd7afc0: Prevent integer overflow when allocating native_handle_t
* commit 'e8582d65ea03a91b5cdc2c374ec9a420f809138f':
  Prevent integer overflow when allocating native_handle_t
2015-05-27 23:23:19 +00:00
Adam Lesinski
e8582d65ea am 9bd7afc0: Prevent integer overflow when allocating native_handle_t
* commit '9bd7afc0a1de9589c13355178b6edc709bd0bddf':
  Prevent integer overflow when allocating native_handle_t
2015-05-27 23:13:06 +00:00
Elliott Hughes
9fc8343772 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
(cherry picked from commit 47b0134ec2)
2015-05-27 13:27:06 -07:00
Andres Morales
93f6cba3ea Merge "[gatekeeperd] return brute-force throttling information" into mnc-dev 2015-05-27 18:37:38 +00:00
Eino-Ville Talvala
0ca24ff56b Merge "Graphics depth formats: Add confidence values" into mnc-dev 2015-05-27 17:40:25 +00:00
Michael Lentine
338142aa81 Merge "Adding a build id check to blob cache." into mnc-dev 2015-05-27 17:39:23 +00:00
Adam Lesinski
9bd7afc0a1 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-27 10:20:03 -07:00
Andres Morales
ae242929da [gatekeeperd] return brute-force throttling information
Bug: 21118563
Change-Id: I13c6a44f61668be8b4c1fde8c84dcfebab84517c
2015-05-27 07:45:22 -07:00
Eino-Ville Talvala
20651b5c7d Graphics depth formats: Add confidence values
Supplement the dense and sparse depth image formats with
confidence values.

For {HAL_PIXEL_FORMAT_Y_16, HAL_DATASPACE_DEPTH}, use the 3 MSBs
for confidence.

For {HAL_PIXEL_FORMAT_BLOB, HAL_DATASPACE_DEPTH}, add a 4th float
value for confidence.

Bug: 20123879
Change-Id: Idc27081efec682a712ce77ccfec59328f298b944
2015-05-26 14:50:48 -07:00
Nick Kralevich
4b7ddd6105 Merge "Don't use TEMP_FAILURE_RETRY on close()" into mnc-dev 2015-05-23 16:04:00 +00:00
Nick Kralevich
12c67f4dfe Don't use TEMP_FAILURE_RETRY on close()
See https://lkml.org/lkml/2005/9/10/129 for details.

(cherry-picked from commit 95db36e128)

Bug: 20501816
Change-Id: I38bf5052f44034c6f866d10d7d07187f0053a7a1
2015-05-23 16:03:06 +00:00
Thierry Strudel
91cf41cf43 init: wait_for_file use smaller time resolution
As 1s timeout can be requested, using second resolution time to check
for timeout prevent from being accurate on the actual time we wait.
Use available gettime_ns instead.

Bug: 21374269
Change-Id: I8be1b69e02beacc7196427f97855e036addf54d1
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-05-22 16:03:12 -07:00
Jim Miller
a552f07f7e Remove unused include
Fixes bug 21370426

Change-Id: I693dc6d741d4ede0a0e44d6b75ade7459ef9a3ed
2015-05-21 13:47:33 -07:00
Jim Miller
62de207fcd Merge "Move from native FingerprintService implementation to fingerprintd" into mnc-dev 2015-05-21 00:57:40 +00:00
Jim Miller
a34dc46c36 Move from native FingerprintService implementation to fingerprintd
This adds a new service, fingerprintd, that manages fingerprint
hardware from a separate process.  It provides a binder interface that
FingerprintManager uses to talk to the fingerprint HAL.

Change-Id: I64b92589f4d75743ebe96894f07bec515945c61e
2015-05-20 14:55:31 -07:00
Mark Salyzyn
94a811ab19 logd: worst-UID only to preserve a day
(cherry pick from commit 833a9b1e38)

Do not invoke worst-UID pruning in the face of other
UIDs logs that are more than a day old, switch to
pruning oldest only.

Change-Id: Icf988b8d5458400a660d0f8e9d2df3f9d9a4c2d9
2015-05-20 10:03:11 -07:00
Nick Kralevich
7eb3abdb3b klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

(cherrypicked from commit 4d32a486fe)

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-19 15:19:25 -07:00
Tao Bao
e48aed0f0a Change pre-recovery into two services
/system/bin/uncrypt needs to be triggered to prepare the OTA package
before rebooting into the recovery. Separate pre-recovery (uncrypt)
into two services: uncrypt that does the uncryption work and
pre-recovery that actually reboots the device into recovery.

Also create /cache/recovery on post-fs in case it doesn't exist.

Bug: 20012567
Bug: 20949086
Change-Id: If67fe1e9ee6279593d2788452febcd3f0fe714c2
2015-05-19 10:04:56 -07:00
Adam Lesinski
0ebd13f063 Merge "Prevent integer overflow when allocating native_handle_t" into mnc-dev 2015-05-19 00:30:24 +00:00
Jeff Brown
ac9131b30c Merge "Add TEMP_FAILURE_RETRY to libsuspend." into mnc-dev 2015-05-18 23:02:52 +00:00
Jeff Brown
0446e16f53 Add TEMP_FAILURE_RETRY to libsuspend.
In testing, I observed one instance of a call failing due to a signal
sent to the process.  This could happen at various times so it's better
to be safe than sorry.

Bug: 20534809
Change-Id: I42242087300d8b840a50aec34aa6b2e1507cab50
2015-05-18 15:53:56 -07:00
Michael Lentine
6078805023 Adding a build id check to blob cache.
Add a build id field to the header structure in blob cache. Add build
id support with reading and writing the cache. When the cache gets
written it writes the build id at the end of the header. When read it
checks to see if there is a match between the current version and the
version in the cache. If not, it invalidates the cache which would
typically only occur during an ota update.  Also remove blob cache
from the host build.

bug: 18262905

Change-Id: I753b1de1986703a4c1c8691b9d2bb533b2546143
2015-05-18 13:14:32 -07:00
Elliott Hughes
4652fc6f08 Revert "Switch to toybox ls."
This reverts commit 9c94aa9982.

Change-Id: Ie2479ee4a0614e285ce8d57c727200a0381904e2
(cherry picked from commit 88f0f4b2b4)
2015-05-15 23:31:08 -07:00
Elliott Hughes
7b071e53fa Switch to toybox ls.
Bug: http://b/21171466
Change-Id: I3fa09db7ca43d337cbda60f10269e7607544982b
(cherry picked from commit 9c94aa9982)
2015-05-15 18:12:16 -07:00
Christopher Ferris
f0861f9f8f Switch UniquePtr to std::unique_ptr.
Bug: 21209050
Change-Id: I91d4c44de479b37f2729382fcdf103b8c69aa668
(cherry picked from commit 6e96403b8f)
2015-05-15 17:41:20 -07:00
Chih-Hung Hsieh
2d543b7d4b Enable clang compilation.
Previous clang/llvm bug was fixed.

BUG: 18790528
Change-Id: Ib12696030d34ebc3c3ef1bca3cad0139d631417e
(cherry picked from commit 1cd02d3443)
2015-05-15 16:13:19 -07:00
Elliott Hughes
2181c722ce Fix ' escaping in adb.
You can't just use \' inside a single-quoted string.

Bug: http://b/20323053
Bug: http://b/3090932
Change-Id: I73754b097671d02dc11c35052f0534b6dd789e4f
(cherry picked from commit 84b0bf2264)
2015-05-15 14:50:47 -07:00
Adam Lesinski
07edc3b3b3 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-15 13:09:39 -07:00
Elliott Hughes
651fae3cbc Reduce the coldboot timeout to 1s.
5s was already a ridiculously long time to delay booting, and some OEMs are
trying to make it even more insane:

  https://www.codeaurora.org/cgit/quic/la/platform/system/core/commit/?h=lp&id=fd23edd48272976d2fb333f377242173f92aa343

Let's at least ensure that Nexus and Android One devices don't take forever
to boot...

Bug: http://b/19899875
Change-Id: I9680c166a759360f34118e51cd0645e12b6bd5c8
(cherry picked from commit c7331d02d1)
2015-05-15 12:18:41 -07:00
Christopher Ferris
eb19e76632 Prevent crashes if a map cannot be created.
Under some conditions, /proc/<pid>/maps might return nothing. If we
try and unwind in this case, we'll crash. Check this case and fail
the unwind.

Add checks that no other functions try and use map_ without
checking for nullptr.

Add logging when an unwind fails so it's clear what happened.

Bug: 21162746
Change-Id: I56ce51dda0cfc9db20475a441f118108196aa07c
(cherry picked from commit 30c942cf10)
2015-05-15 11:32:53 -07:00
Andres Morales
c89a1774cb Merge "Move SoftGateKeeper into gatekeeperd" into mnc-dev 2015-05-14 20:06:11 +00:00