Commit Graph

21573 Commits

Author SHA1 Message Date
Elliott Hughes 2a7f7e0090 Move libnativeloader headers into libnativeloader.
Change-Id: I227676276da1b08a84486f29fb0e1502c8dbdf4a
(cherry picked from commit e2b4e1e00c)
2016-02-22 15:23:22 -08:00
Sami Tolvanen 0bdad0f231 logd: enforce policy integrity
If a SELinux policy change or a switch to permissive mode is detected
on a user build, restart the device into safe mode, and keep it there
until an OTA is applied or user data is wiped.

This change deprecates the ro.logd.auditd property.

Needs matching changes from
  I781c3059ea8d4fb2f0c923e4488b1932d69678d3
  Ica825cf2af74f5624cf4091544bd24bb5482dbe7
  Id3ca7889ede30b54b7af73dd50653ca1a20d59aa

Bug: 26902605
Change-Id: Idcdc5bff133f13c1267f0ec0a75cc8cf1ddbda0d
(cherry picked from commit d122ee65b6)
2016-02-22 14:00:43 -08:00
James Hawkins 35349148e1 bootstat: Record metrics for factory_reset and time_since_factory_reset.
Bug: 25448351
Change-Id: I9b3a557317bc256a078f76e2b65d16bc071e4a6a
(cherry picked from commit 500d71566a)
2016-02-22 13:30:11 -08:00
Calin Juravle aed972dead Merge "Create profiles folders" into nyc-dev 2016-02-22 11:42:02 +00:00
Pablo Ceballos f411123ea0 Merge "Add the setAutoRefresh interface in ANativeWindow" into nyc-dev 2016-02-20 18:22:29 +00:00
Mohamad Ayyash 73b64aa8f8 Revert "Revert "Update make_ext4fs_internal param-list to match new implementation""
This reverts commit 527cc0b7a4.

Change-Id: I0c5705ae6e0188797b910df3ada614cacf1d835e
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-19 20:40:22 -08:00
Jeff Sharkey a9061ece05 Merge "Temporary fix for bugreport symlink." into nyc-dev 2016-02-19 22:52:47 +00:00
Jeff Sharkey 002aecf6e8 Temporary fix for bugreport symlink.
Bug: 27262109
Change-Id: I011da38f8ad1eeaf717dc03a0fb6f9fdc5654c4c
2016-02-19 15:51:42 -07:00
Colin Cross de42af013f libmemunreachable: fix long timeout on error
The collection thread should unblock the parent when it fails in order
to prevent a 100 second timeout delay.  Also reduce the timeout to 30
seconds, and fix a few log messages.

Bug: 27208635
Change-Id: I47f9ce4f645c453810fec57bef557c32a665eefb
(cherry picked from commit b1b7923efe)
2016-02-19 14:06:13 -08:00
Mohamad Ayyash 527cc0b7a4 Revert "Update make_ext4fs_internal param-list to match new implementation"
This reverts commit 6d94dfee45.

Change-Id: Iec0832740e321e31a78a31d5358542d2ed4455fa
2016-02-19 21:16:38 +00:00
Mohamad Ayyash 6d94dfee45 Update make_ext4fs_internal param-list to match new implementation
BUG: 26839493
Change-Id: I4cd316ebc91457e2ec31c0e8b116798d9f94a223
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-19 18:34:59 +00:00
Calin Juravle 807f23aff2 Create profiles folders
Current profiles (the ones which have not been used for
compilation) are stored in /data/misc/profiles/cur/0/pkgname/.

Reference profiles (the merged of all user profiles, used for
compilation) are stored in /data/misc/profiles/ref/pkgname/.

Add a method to get the shared app gid from an uid or appid.

Bug: 26719109
Bug: 26563023
Change-Id: I89601d7dbeb3041df882c141a9127dac200a645e
2016-02-19 13:42:37 +00:00
Colin Cross 7add50d820 imprecise mark and sweep native memory leak detector
libmemunreachable uses an imprecise mark and sweep pass over all memory
allocated by jemalloc in order to find unreachable allocations.

Bug: 27208635
Change-Id: Ia70bbf31f5b40ff71dab28cfd6cd06c5ef01a2d4
(cherry picked from commit bcb4ed3eaa)
2016-02-19 00:49:36 -08:00
Dimitry Ivanov dab56737ca Limit libart.so visibility to apps targeting <= M
Add libart.so to the list of public libraries only for
apps targeting android M and below.

Bug: http://b/27210062
Bug: http://b/26436837
Change-Id: I1ed3b0335a343044a76273741ea8770dcce12ebe
2016-02-17 17:22:20 -08:00
David Pursell 7bbb4a0c49 Merge changes Ib17f0a55,Ia5bbae6b,I339d42fc into nyc-dev
* changes:
  fastboot: fix TCP protocol version check.
  fastboot: add UDP protocol.
  fastboot: add Socket timeout detection.
2016-02-17 22:02:19 +00:00
David Pursell 022d8f5885 fastboot: fix TCP protocol version check.
Currently the TCP handshake fails if the device TCP protocol version
doesn't match the host exactly, but the protocol is supposed to allow
for forwards compatibility by accepting any protocol version >= itself.
That way the other side can potentially lower its protocol to match and
keep going.

This CL fixes the protocol version check and adds corresponding unit
tests.

Bug: http://b/27220700

(cherry picked from commit aad72a533f)

Change-Id: Ib17f0a55eb910105a27609bc94bf76a30442e92e
2016-02-17 13:22:40 -08:00
David Pursell 5a0ec81e97 fastboot: add UDP protocol.
Implements a UDP protocol for fastboot, documented in
fastboot_protocol.txt.

This version of the protocol does not include multi-packet windowing,
which will likely be needed to achieve reasonable speeds over WiFi.
Since we don't have any WiFi use cases yet, we'd like to get this in
now and update the protocol later if it becomes necessary.

Usage:
  fastboot -s udp:<hostname>[:port] <command>

Bug: http://b/26154914

(cherry picked from commit 4601c978ca)

Change-Id: Ia5bbae6bcd6405671f594d7120b3994746d234d3
2016-02-17 13:22:30 -08:00
David Pursell 8bcce68f10 fastboot: add Socket timeout detection.
UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.

I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.

Bug: http://b/26154914

(cherry picked from commit c742a7f174)

Change-Id: I339d42fc40d853ee48d1b457d06b67faf5799d91
2016-02-17 13:22:17 -08:00
Mohamad Ayyash 14ae3f2b50 Add CASIO to approved vendor IDs am: 6c48349dee
am: 1dec743e01  -s ours

* commit '1dec743e01498fc8e6cd01cf71d12aa2b1431018':
  Add CASIO to approved vendor IDs
2016-02-17 17:34:55 +00:00
Mohamad Ayyash 1dec743e01 Add CASIO to approved vendor IDs
am: 6c48349dee

* commit '6c48349deec6d7b6e654067416790fe16c69c28e':
  Add CASIO to approved vendor IDs
2016-02-17 07:01:15 +00:00
Mohamad Ayyash 6c48349dee Add CASIO to approved vendor IDs
BUG: 27021418
Change-Id: I083447d3555891db4fced2171a0a747882c4435a
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-02-16 20:14:01 -08:00
Lorenzo Colitti 8bb06b6493 Merge "Tolerate RTM_DELADDR messages from deleted interfaces." into nyc-dev 2016-02-17 03:06:57 +00:00
James Hawkins def841933f Merge "bootstat: Add a few more bootreasons and rebase the index against index 1." into nyc-dev 2016-02-17 00:01:48 +00:00
Josh Gao cb9625cbe5 Don't create tombstone directory.
Partial backport of cf79748.

Bug: http://b/26403620
Change-Id: Ib877ab6cfab6aef079830c5a50ba81141ead35ee
2016-02-16 15:09:46 -08:00
Nick Kralevich e2796207ee ensure /data/tombstones exists on all Android devices
/data/tombstones is referenced by core platform code, but is not
guaranteed to exist on all Android devices. Move the directory
creation out of device specific files and into the core
init.rc file.

Bug: https://code.google.com/p/android/issues/detail?id=93207
Change-Id: I94ae5199a6a32c4fe555ca994fc4a8345e0c9690

Bug: http://b/26403620
(cherry picked from commit 0359d778a5)
2016-02-16 15:09:43 -08:00
Josh Gao 557749e55b Don't create tombstone directory. DO NOT MERGE
Partial backport of cf79748.

Bug: http://b/26403620
Change-Id: I412889bfa331c96ad8e2ce6e0d66b54fb230e8c0
2016-02-16 15:07:35 -08:00
Josh Gao 9515c23e16 debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
Effectively a cherry-pick of 04f9b2a.

Bug: http://b/26403620
Change-Id: I0437fdc774501f428d8b4f8dd7682b32eaa29cef
2016-02-16 15:07:35 -08:00
Nick Kralevich 9c0ed66313 ensure /data/tombstones exists on all Android device. DO NOT MERGE
/data/tombstones is referenced by core platform code, but is not
guaranteed to exist on all Android devices. Move the directory
creation out of device specific files and into the core
init.rc file.

Bug: https://code.google.com/p/android/issues/detail?id=93207
Change-Id: I94ae5199a6a32c4fe555ca994fc4a8345e0c9690

Bug: http://b/26403620
(cherry picked from commit 0359d778a5)
2016-02-16 15:07:29 -08:00
Lorenzo Colitti ef6454d3d3 Tolerate RTM_DELADDR messages from deleted interfaces.
When an interface is deleted (which can happen, for example, to
the tun interfaces used for VPN and 464xlat), the kernel sends
RTM_DELADDR messages for all its IP addresses.

Currently we ignore these because we cannot fetch the interface
name. Instead, pass them up with an empty interface name so that
NetlinkHandler can do something useful for them, such as destroy
connections on the IP addresses that are being deleted.

Bug: 26976388
Change-Id: I2ced7e389228f9d665d0a87d97bd3452c8c0c98b
2016-02-16 23:12:26 +09:00
Jeff Sharkey 7916cc9e40 Re-derive permissions after package changes. am: a44febd19b am: 36a6835aa5
am: 77a3c8fccd

* commit '77a3c8fccd17d0091776aeac38bda86e43d67979':
  Re-derive permissions after package changes.
2016-02-14 22:50:44 +00:00
Jeff Sharkey 77a3c8fccd Re-derive permissions after package changes. am: a44febd19b
am: 36a6835aa5

* commit '36a6835aa5c40c5a83400c2fb162bd6fd5c5f878':
  Re-derive permissions after package changes.
2016-02-14 22:39:02 +00:00
Jeff Sharkey 36a6835aa5 Re-derive permissions after package changes.
am: a44febd19b

* commit 'a44febd19b4efd17fe31d75c964ec47f85832a2a':
  Re-derive permissions after package changes.
2016-02-14 22:28:35 +00:00
James Hawkins ee79e73373 bootstat: Add a few more bootreasons and rebase the index against index 1.
This is necessary to match the mapping in the internal infrastructure.

Bug: 21724738
Change-Id: I292166ff5c0dea7f3d771627120f16af4c56073b
(cherry picked from commit 6f74c0b843)
2016-02-13 14:02:25 -08:00
Jeff Sharkey a44febd19b Re-derive permissions after package changes.
When packages change, existing package-specific directories may have
gained/lost a UID mapping, so we need to update the permissions for
any in-memory nodes.

This allows an app to deliver data for another package before that
package is installed, which is the typical pattern of how OBB files
are delivered.

Also fix bug by re-deriving permissions when files are moved.

Bug: 25399427
Change-Id: I06f38a24ad7dee5f5099ba81429aef03208e5683
(cherry picked from commit f7aad11c1c)
2016-02-12 20:37:05 +00:00
James Hawkins 5022909765 Merge "bootstat: Add support for logging the boot_reason metric." into nyc-dev 2016-02-11 19:14:28 +00:00
James Hawkins 10f54be6d0 bootstat: Add support for logging the boot_reason metric.
This value is read from the ro.boot.bootreason system property.

Bug: 21724738
Change-Id: I43bef3d85ba9c8d87669a91da1aa675d9a86e348
(cherry picked from commit a4a1a4ac85)
2016-02-11 10:37:33 -08:00
Dimitry Ivanov d68c8e9f84 Preload public native libraries
Preload libraries needed by the public namespace
at the earlier stage. This saves time on
InitPublicNamespace and saves memory because
the libraries are linked before zygote fork.

Bug: http://b/26409579
Change-Id: I59153a4180b930f31b542d8d2cb17b5d63c36774
2016-02-11 10:22:38 -08:00
Pablo Ceballos 3daa57490e Add the setAutoRefresh interface in ANativeWindow
Bug 24940410

Change-Id: I6c0d149c63236f169897c64b21563630fb034338
2016-02-09 17:17:21 -08:00
Lajos Molnar 9136922045 Expand HAL_DATASPACE to include range, standard and transfer bitfields
Bug: 25975353
Change-Id: Id2668508b523130e5fa3496440d9423682b31632
2016-02-10 00:21:37 +00:00
Paul Crowley c31f1f3f6e Check for breadcrumbs only where relevant
Don't look for breadcrumb files like convert_fde unless the fstab
flags indicate we actually care whether they are present or absent.

Bug: 26989796
Change-Id: I3cde9896b22fc6f5a4b63dc3f97ac4e3588b5568
2016-02-09 21:05:01 +00:00
Elliott Hughes b71e897003 Fix generation of event labels for getevent.
The recent uapi header update moved all the interesting constants
out into another file. Track that, and add the missing makefile
dependency.

Bug: http://b/27073568

(cherry picked from commit bd02a47b22)

Change-Id: I9323a995511b12905949cba22c59cc28623068f3
2016-02-09 11:24:42 -08:00
Martijn Coenen 5badce35f0 Merge "lmkd: subscribe to low mempressure events." into nyc-dev 2016-02-09 10:27:48 +00:00
Martijn Coenen 9010a2398e lmkd: subscribe to low mempressure events.
This will make sure we get invoked in time,
and combined with a kernel change to increase
the window size (and thus rate-limit the
notifications) based on the amount of memory
on the device, this should provide a nice
balance between receiving too many notifications
vs getting notified too late.

Change-Id: I2f5e92390b94e582aaa06d88763a232e39673496
2016-02-09 11:25:18 +01:00
Martijn Coenen 623b56af5d Fix libprocessgroup SELinux denials.
libprocessgroup checks whether it can use memory
cgroups for keeping track of forked processes by
seeing whether /dev/memcg/apps is writable. However,
on systems with memory cgroups disabled, SELinux
(correctly) no longer classifies this directory as a cgroup,
and starts denying zygote access. To fix this,
first check whether /dev/memcg/apps/tasks exists to
see if the cgroup is mounted; only then check whether
we can write to the directory.

Bug: 27046965
Change-Id: I6e44cd62d8c396e20ceb162c50606b3e86f2cb3e
2016-02-08 11:45:27 +01:00
Jeff Sharkey 23419e3926 Merge "Follow migration of Shell app to DE storage." 2016-02-07 03:57:31 +00:00
Jeff Sharkey c457610e78 Follow migration of Shell app to DE storage.
The Shell app that stores bugreports now lives under DE storage for
all devices, both FBE and non-FBE.

Bug: 26668510
Change-Id: Iead1dcb98181a5caccf4d0c1e86de62abc6dc990
2016-02-06 20:15:24 -07:00
Christopher Ferris b3625f50b2 Merge "Fix use of uninitialized memory." am: 45c8586dad
am: 50443ed1ad

* commit '50443ed1ad7a0765030eefb557f9252a46e274db':
  Fix use of uninitialized memory.
2016-02-06 03:51:50 +00:00
Christopher Ferris 50443ed1ad Merge "Fix use of uninitialized memory."
am: 45c8586dad

* commit '45c8586dad4796fa227b60745ba2d0dbae44b062':
  Fix use of uninitialized memory.
2016-02-06 03:49:36 +00:00
Christopher Ferris 45c8586dad Merge "Fix use of uninitialized memory." 2016-02-06 03:46:28 +00:00
Christopher Ferris d4c884330c Fix use of uninitialized memory.
When creating an UnwindMapLocal fails in the Build() function call,
the destructor for UnwindMap is called. Unfortunately, the map_cursor_
member variable has not been initialized, so the call to destroy it
winds up operating on garbage data.

Part of this is a result of a bad class hierarchy, so this refactors
the classes slightly, and properly initializes the map_cursor_ member
variable in the base class.

Bug: 26931578
Change-Id: I885596bf65e4ef63559cee2c56cd41576d5ecc1b
2016-02-05 15:22:34 -08:00