Commit Graph

676 Commits

Author SHA1 Message Date
Romain Guy
95b52fd187 Make Half look like and behave like a boxed instance
Bug: 35765416
Test: HalfTest
Change-Id: I7ef52428f8b4e2c05b91d7eb37cc4cb5ecc5c6b9
2017-02-26 09:37:52 -08:00
Andy Hung
50fb1aebd7 Spline: Fix monotonicity constraint
Test: comparison of code to formula
Change-Id: Ie7c8b3a2a6bc64ea3c837a6674b55c07fe49e12b
2017-02-10 13:53:43 -08:00
TreeHugger Robot
b66cfe8a88 Merge "Added support to authentication." 2017-01-26 01:35:39 +00:00
Dianne Hackborn
c5d458930c Merge "Add some new experiment constants for activity and power manager." 2017-01-25 21:12:12 +00:00
Felipe Leme
436ab6a91d Added support to authentication.
AutoFillService can now require user authentication, both at
FillResponse and Dataset levels;
- FillResponse authentication is typically used when the user data
  need to be unlocked before the first use.
- Dataset authentication is typically used to unlock sensitive data
  such as credit card info.

The authentication can be handled by the service itself (for example,
when it uses the credit card CVV to unlock it) or by the Android
system (when the service asks for fingerprint authentication).

Bug: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: If62f42f697ab5ef0d14d991ff1077d1c38808e61
2017-01-25 13:03:32 -08:00
Mark Rathjen
8bd8564a18 Merge "Resolve Android security comments for Android ID migration." 2017-01-25 20:20:29 +00:00
Dianne Hackborn
0ef403e53e Add some new experiment constants for activity and power manager.
Activity manager now has constants, starting with two: bg check
and process limit.

Power manager now has constants, starting with one: controlling
disabling of wake locks from cached processes.

Test: manual

Change-Id: I05db42e2104e9d31584f85251412df2d5efb34b6
2017-01-24 18:23:45 -08:00
Mark Rathjen
7599f1366e Resolve Android security comments for Android ID migration.
- Use 32 byte key instead of 16 byte.
- Use HMAC-SHA256 instead of SHA256 for ssaid generation.
- Update HMAC with all package signatures.
- Use delimiter in between digest arguments.

This change will cause the ssaid of non-legacy installed apps (apps installed
post Android ID migration OTA) to change after an uninstall and reinstall sequence.

Bug: 34395671
Test: Unit tests, CTS tests, Manual tests
Change-Id: I19dec57947368ee5000c2c630b1e4030d46a4ab3
2017-01-23 19:06:41 -08:00
TreeHugger Robot
ec30d6e12f Merge "add a signaled reader to the eventlog" 2017-01-23 18:18:30 +00:00
Chris Wren
d09bf8271e add a signaled reader to the eventlog
Test: manual using a logspammer app
Change-Id: I89e3dda82d4d1d3fc6d343b634642687e550f70a
2017-01-23 11:40:52 -05:00
Jeff Sharkey
f5d2c7278e Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741 am: c3fbf32011 am: 4a0a4664b9
am: 7bb9ccc1e5

Change-Id: I9346a576d57c9f7093b875c4a43134f2ef095018
2017-01-20 23:12:19 +00:00
Jeff Sharkey
4a0a4664b9 Merge "Add Binder support for Parcelable exceptions." am: a2ef6b5741
am: c3fbf32011

Change-Id: Ibd977a017ce48f0791520af3500969aec0c132e5
2017-01-20 22:56:45 +00:00
Mark Rathjen
c45df0d7c1 Merge "Roll forward SSAID Migration to be Per App/User Unique Values." 2017-01-19 04:21:47 +00:00
Mark Rathjen
d891f01d96 Roll forward SSAID Migration to be Per App/User Unique Values.
SSAID is currently shared across all applications for each
user on the device, giving developers the ability to track
users across multiple applications. Using SSAID for tracking
is an abuse of the original intention of the SSAID and has
inherent privacy concerns.

This change will make the SSAID unique per application, per
user on a device. To not affect applications installed prior
to this change they will retain the legacy SSAID value until
uninstalled and reinstalled again.

Across subsequent installations the application will receive
the same SSAID as long as the package name and signature remain
consistent.

Tested manually the following cases:
  - App retains the legacy sssaid after OTA.
  - App gets a new ssaid upon post-OTA installation.
  - App retrieves same ssaid across post-OTA unistall/reinstalls.
  - Different Apps receive different ssaids.
  - Factory reset removes ssaid data and generates a different
    ssaid after App install.
  - System retains legacy ssaid.

Bug: 34395671
Test: CTS tests passed, Manual testing passed

This reverts commit be43257005.

Change-Id: Ibf20e7949304c30d65bb8aa24cdbbe6e104b1002
2017-01-19 04:10:37 +00:00
Mark Rathjen
5256e0556b Merge "Revert "SSAID Migration to be Per App/User Unique Values."" 2017-01-19 00:25:50 +00:00
Mark Rathjen
be43257005 Revert "SSAID Migration to be Per App/User Unique Values."
This reverts commit 5514fb7aba.

Change-Id: I0d6b9b9ef3ecda3b7ec1b7160c492ec16c65b125
2017-01-18 23:08:48 +00:00
Mark Rathjen
8bd15d1df2 Merge "SSAID Migration to be Per App/User Unique Values." 2017-01-17 23:57:17 +00:00
Jeff Sharkey
e628b7d446 Add Binder support for Parcelable exceptions.
If an Exception thrown by a Binder call implements the Parcelable
interface, then parcel it and rethrow back at the caller.  There is
strict requirement that these Parcelable exceptions must be defined
by the system (as determined by checking the ClassLoader).  We prefix
the Parcelable contents with a length so that native code can skip
over the blobs.

Define a new ParcelableException class that can be used to transport
exceptions that cannot be modified to add Parcelable behavior, and
switch ExceptionUtils to use this new class for sending IOExceptions.

Test: builds, boots, wrapped exceptions work
Bug: 33749182
Change-Id: I1352ea1566ddf01120d9d0e819ba6f70fc407e11
2017-01-17 14:22:07 -07:00
Mark Rathjen
5514fb7aba SSAID Migration to be Per App/User Unique Values.
SSAID is currently shared across all applications for each
user on the device, giving developers the ability to track
users across multiple applications. Using SSAID for tracking
is an abuse of the original intention of the SSAID and has
inherent privacy concerns.

This change will make the SSAID unique per application, per
user on a device. To not affect applications installed prior
to this change they will retain the legacy SSAID value until
uninstalled and reinstalled again.

Across subsequent installations the application will receive
the same SSAID as long as the package name and signature remain
consistent.

Tested manually the following cases:
  - App retains the legacy sssaid after OTA.
  - App gets a new ssaid upon post-OTA installation.
  - App retrieves same ssaid across post-OTA unistall/reinstalls.
  - Different Apps receive different ssaids.
  - Factory reset removes ssaid data and generates a different
    ssaid after App install.
  - System retains legacy ssaid.

Bug: 30979321
Test: CTS tests passed, Manual testing passed
Change-Id: I4acc190c14ec249e6365e05e7943148ed6f17f71
2017-01-17 11:22:07 -08:00
Makoto Onuki
3453194360 Deprecate all inconvenient methods
Test: builds fine
Change-Id: I52a26d160cff44b2fa0f3a807d23a6ed586d16ce
2017-01-17 11:20:41 -08:00
Mark Salyzyn
db15537e6e resolve merge conflicts of 082a1721b5 to master
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I17f178f425975c1c0dbd48091d25b101956d505e
2017-01-11 08:30:17 -08:00
Mark Salyzyn
ef8ccc8510 Merge "Replace cutils/log.h and log/logger.h with log/log.h" am: e7fcbcb991
am: 6143cbf1e5

Change-Id: Id192d8dd973fe9e70acab72bae9856bc8a62ac75
2017-01-11 15:40:24 +00:00
Mark Salyzyn
52eb4e01a4 Replace cutils/log.h and log/logger.h with log/log.h
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I578b15b48f0fc2807a92abbc69a377c3d2191496
2017-01-09 14:31:34 -08:00
Alex Klyubin
aa34861b34 Merge "Permit 65535 byte ZIP comments and empty Central Directory" am: f420b91e26 am: be81b50b6e am: e1bc33228e
am: 9c280d1566

Change-Id: I45452e71df0779b69b77e2dd1691a6fa27868e74
2016-12-20 21:17:17 +00:00
Alex Klyubin
e1bc33228e Merge "Permit 65535 byte ZIP comments and empty Central Directory" am: f420b91e26
am: be81b50b6e

Change-Id: I1275903e7fda6bdd9c1012bc7cfb6c42f6b43304
2016-12-20 20:45:59 +00:00
Alex Klyubin
9694657967 Permit 65535 byte ZIP comments and empty Central Directory
This fixes two cosmetic issues in APK Signature Scheme v2 signature
verifier in Android Package Manager:
* Accept APKs with ZIP End of Central Directory comment of length
  65535. Previously, only comments of length 65534 were accepted due
  to a off by one bug.
* Accept APKs with empty ZIP Central Directory.

These issues should not affect actual APKs because they cannot have an
empty ZIP Central Directory (they must contain at least the
AndroidManifest.xml entry) and shouldn't contain any comments in ZIP
End of Central Directory.

Test: cts-tradefed run singleCommand cts --skip-device-info --skip-preconditions --skip-connectivity-check --abi arm64-v8a --module CtsAppSecurityHostTestCases -t android.appsecurity.cts.PkgInstallSignatureVerificationTest
Change-Id: I461c43472fa97c04e7579d129a6053e44233adb7
2016-12-19 12:53:32 -08:00
Chris Wren
d9f3d9edc0 Don't WTF when reading empty data from the eventlog
Bug: 33446064
Fixes: 33446064
Test: run cts -m CtsUtilTestCases -t android.util.cts.EventLogTest
Change-Id: I4951202cd7d6ca441700b7122cfa3aae2167c7b0
2016-12-19 12:51:34 -05:00
Svetoslav Ganov
69b9db8c5d Fix vulnerability in MemoryIntArray am: 1181f448c1 am: d08cf2b071
am: 385277305e

Change-Id: I3d7222359d095d5e53f3e6fbfeda10352fa43f76
2016-12-09 01:52:56 +00:00
Svetoslav Ganov
d08cf2b071 Fix vulnerability in MemoryIntArray
am: 1181f448c1

Change-Id: I4217066be49bb9525e945f110c22eb864ec6c212
2016-12-09 01:43:52 +00:00
Svetoslav Ganov
1181f448c1 Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

Further, we now check the memory mapped size against
the size of the underlying ashmem region after we do
the memory mapping (to fix the ahsmem size) and if
an attacker changed the size under us we throw.

Tests: Updated the tests and they pass.

bug:33039926
bug:33042690

Change-Id: Ibf56827209a9b791aa83ae679219baf829ffc2ac
2016-12-09 00:08:33 +00:00
Bill Napier
1c47e9e8f0 Revert "Fix vulnerability in MemoryIntArray am: a97171ec49" am: 43966dafb3 am: 498547ec6c
am: ef435f6780

Change-Id: I6b879ca7e2c7c48885dcdbf791afcd914869df24
2016-12-08 22:40:09 +00:00
Bill Napier
498547ec6c Revert "Fix vulnerability in MemoryIntArray am: a97171ec49"
am: 43966dafb3

Change-Id: I01bc83edd411dc39cb696e64ea35b5d4a8497fbf
2016-12-08 22:30:02 +00:00
Bill Napier
43966dafb3 Revert "Fix vulnerability in MemoryIntArray am: a97171ec49"
This reverts commit fb12dd509f.

Change-Id: I9e1b22b8df0e754095541a758096cba279a81ab1
2016-12-08 22:22:38 +00:00
Svetoslav Ganov
e812cd0379 Fix vulnerability in MemoryIntArray am: a97171ec49 am: fb12dd509f am: a5ee109029
am: 5250d90637

Change-Id: I20c20bee05321d722e83ee47ad6d13e308178e02
2016-12-08 21:51:05 +00:00
Svetoslav Ganov
a5ee109029 Fix vulnerability in MemoryIntArray am: a97171ec49
am: fb12dd509f

Change-Id: I269ec7d61ebdc9f485d759d1398d5fa4eacf868f
2016-12-08 21:42:05 +00:00
Svetoslav Ganov
fb12dd509f Fix vulnerability in MemoryIntArray
am: a97171ec49

Change-Id: Ifa2221a9b8ca705ef0239d61772938ac11761ce2
2016-12-08 21:37:33 +00:00
Svetoslav Ganov
a97171ec49 Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

 Further, we now check the memory mapped size against
 the size of the underlying ashmem region after we do
 the memory mapping (to fix the ahsmem size) and if
 an attacker changed the size under us we throw.

 Tests: Updated the tests and they pass.

 bug:33039926
 bug:33042690

Change-Id: I1004579181ff7a223ef659e85c46100c47ab2409
2016-12-08 11:51:26 -08:00
Svetoslav Ganov
fe9fc973bd Revert "Fix vulnerability in MemoryIntArray" am: 1f06508bc6 am: 64b5725900 am: 60357eb6bd
am: 590b77da13

Change-Id: Ida195bcbaf3c3fad184865938dfff9f475879c16
2016-12-08 02:40:55 +00:00
Joe Onorato
be5378574b Merge changes from topic 'proto convenience methods'
* changes:
  ProtoOutputStream convenience methods.
  Give protoc-gen-javastream the ability to output multiple java files.
2016-12-08 02:39:50 +00:00
Svetoslav Ganov
60357eb6bd Revert "Fix vulnerability in MemoryIntArray" am: 1f06508bc6
am: 64b5725900

Change-Id: Id7021fb02059cfb3bb9184ef24f417c0be7f55b9
2016-12-08 02:33:00 +00:00
Svetoslav Ganov
64b5725900 Revert "Fix vulnerability in MemoryIntArray"
am: 1f06508bc6

Change-Id: Id387817495b1857f304203c8487da3db49bdd0e4
2016-12-08 02:29:00 +00:00
Svetoslav Ganov
1f06508bc6 Revert "Fix vulnerability in MemoryIntArray"
This reverts commit 4694cad511.

Change-Id: I235ea3c4bd86d90bf97bc1a2d023f4780251e570
2016-12-08 02:17:40 +00:00
Svetoslav Ganov
638134c1d8 Fix vulnerability in MemoryIntArray am: 4694cad511 am: ec40a70ffb am: 138a541eaa
am: 557858b9c0

Change-Id: I872df5965848ccd935c43473168e1e5aea40aad1
2016-12-08 02:08:26 +00:00
Aart Bik
7eb917d5eb Revert "Fix vulnerability in MemoryIntArray" am: 29139a8ae5 am: 86699f980f am: 65cf055ad9
am: 278cad4793

Change-Id: Ib58a5a1e7506327b690df9c1a98c2fa8b895d216
2016-12-08 02:01:06 +00:00
Svetoslav Ganov
138a541eaa Fix vulnerability in MemoryIntArray am: 4694cad511
am: ec40a70ffb

Change-Id: I5d03aaa04fe13b3af20bcc61e9bb925b471ab825
2016-12-08 01:56:24 +00:00
Svetoslav Ganov
ec40a70ffb Fix vulnerability in MemoryIntArray
am: 4694cad511

Change-Id: I64257a851c06e4a333056ee132ff8a2ea29aef5c
2016-12-08 01:49:21 +00:00
Aart Bik
65cf055ad9 Revert "Fix vulnerability in MemoryIntArray" am: 29139a8ae5
am: 86699f980f

Change-Id: I7876874ba0d6815920f21021a47e3fe1b3e1c42f
2016-12-08 01:44:54 +00:00
Aart Bik
86699f980f Revert "Fix vulnerability in MemoryIntArray"
am: 29139a8ae5

Change-Id: I3975cfc51bd03a65855c113dfdb827d24471e0ba
2016-12-08 01:36:50 +00:00
Svetoslav Ganov
4694cad511 Fix vulnerability in MemoryIntArray
MemoryIntArray was using the size of the undelying
ashmem region to mmap the data but the ashmem size
can be changed until the former is memory mapped.
Since we use the ashmem region size for boundary
checking and memory unmapping if it does not match
the size used while mapping an attacker can force
the system to unmap memory or to access undefined
memory and crash.

Also we were passing the memory address where the
ashmem region is mapped in the owner process to
support cases where the client can pass back the
MemoryIntArray instance. This allows an attacker
to put invalid address and cause arbitrary memory
to be freed.

Now we no longer support passing back the instance
to the owner process (the passed back instance is
read only), so no need to pass the memory adress
of the owner's mapping, thus not allowing freeing
arbitrary memory.

Further, we now check the memory mapped size against
the size of the underlying ashmem region after we do
the memory mapping (to fix the ahsmem size) and if
an attacker changed the size under us we throw.

Tests: Updated the tests and they pass.

bug:33039926
bug:33042690

Change-Id: Id7f0e8a4c861b0b9fa796767e0c22d96633b14d1
2016-12-08 01:35:08 +00:00
Aart Bik
29139a8ae5 Revert "Fix vulnerability in MemoryIntArray"
This reverts commit 86dfa094de.


BROKE BUILD (as shown in some treehugger builds)

frameworks/base/core/java/android/util/MemoryIntArray.java:84: error: cannot find symbol
        mCloseGuard.open("close");
        ^
        
       
bug:33039926
bug:33042690

Change-Id: Ief875e543ec849fe55c747fb1ed5253f0cd9a122
2016-12-08 01:12:48 +00:00