Commit Graph

21601 Commits

Author SHA1 Message Date
Nick Kralevich 99fb01e42a Revert "logd: Don't trigger an integrity failure on permissive SELinux denials"
external/sepolicy commit bca98efa575bedab68f2d5eaee2cd1fd1741962b
ensures that no permissive domains can be on user builds, and
external/sepolicy commit 3872ee396898fcb23bdc49c37fd02d81014aaa5f
re-enables enforcing mode on cameraserver.

The conditions which lead to the integrity failure detection
triggering can no longer occur. Revert the patch which relaxed
the detection.

This reverts commit 33ee84f871.

Bug: 27313768
Bug: 26902605
Change-Id: I8ee97d0858345695f9df8240de4e696f4a9ba008
2016-02-27 08:31:57 -08:00
Nick Kralevich 33ee84f871 logd: Don't trigger an integrity failure on permissive SELinux denials
Only trigger an integrity failure if a policy is reloaded or
SELinux is disabled. Don't trigger the integrity failure if
we see a permissive=1 denial, which could occur if an SELinux
domain is in permissive mode.

Bug: 27313768
Bug: 26902605
Change-Id: Ib85a2799eb6378ae8acdb965b1812d691183fdd3
2016-02-26 17:00:15 -08:00
Stephen Hines 242393fec1 Merge "Fix windows 64-bit builds" into nyc-dev 2016-02-26 23:34:39 +00:00
Ruchi Kandoi 1d043484d4 Merge "healthd: Correct the scaling factor for maxVoltage and maxCurrent." into nyc-dev 2016-02-26 21:27:47 +00:00
Ruchi Kandoi 5c09ec1726 healthd: Correct the scaling factor for maxVoltage and maxCurrent.
Change-Id: I93a4c916d0c742710c00c0b15d8d1de6b8f8d1c2
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-02-26 10:09:28 -08:00
Dimitry Ivanov 94da34a8fa Merge "Added function to explicitly initialize a namespace" into nyc-dev 2016-02-26 18:03:56 +00:00
Todd Kjos d125f6e8a9 Merge "Mount schedTune cgroup as /dev/stune" into nyc-dev 2016-02-26 17:35:50 +00:00
Lajos Molnar 1e86e1ba1a Merge "keep legacy HAL_DATASPACE enums unchanged" into nyc-dev 2016-02-26 05:06:13 +00:00
Dan Willemsen 9dddd137c7 Fix windows 64-bit builds
pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718

(cherry picked from commit 86cf941c48)

Change-Id: I8d39d1951fea1b3011caf585c983e1da7959f7c0
2016-02-25 18:43:55 -08:00
Casey Dahlin 97b3e66d3e Introduce unique_fd
unique_fds are wrappers for integer file descriptors that automatically
close when they go out of scope. They are movable but not copyable and
generally mimic the semantics of std::unique_ptr

(cherry-pick from 918b9e8dc6)

Change-Id: I0657b848b6536d5ad9fc06686e240ea5c387b0ac
Test: Considerable exercise in new AIDL integration tests
Bug: None
Signed-off-by: Casey Dahlin <sadmac@google.com>
2016-02-25 17:02:17 -08:00
Mark Salyzyn dad8361a0e Merge changes Ic15a87f4,I8a53ad3a,I6a03d405 into nyc-dev
* changes:
  liblog: __android_log_error_write use event list library
  liblog: test: __android_log_error_write accuracy
  liblog: add android_log_write_string8_len
2016-02-25 23:55:59 +00:00
Mark Salyzyn a4f2ef1b05 liblog: __android_log_error_write use event list library
(cherry pick from commit 81f407be36)

Switch to the event list library to compose the associated event.

SideEffects: Instead of composing event on a stack buffer of 512
             bytes in size, a PAGE is allocated temporarily.

Bug: 27356456
Change-Id: Ic15a87f49385834c2287ed82c26439b2c5eb4f77
2016-02-25 15:54:28 -08:00
Mark Salyzyn d9aee653d1 liblog: test: __android_log_error_write accuracy
(cherry pick from commit 5cecedc6e8)

Add a test to confirm exact expected content using the testframe
setup for the events log handler. Remove dependency on 512 truncation
in liblog->
android_errorWriteWithInfoLog__android_logger_list_read__data_too_large
to something more liberal.

Bug: 27356456
Change-Id: I8a53ad3a16cf16b14856efe5b95417e857c7e09b
2016-02-25 15:53:44 -08:00
Tim Murray b43225eefb Fix build break with uninitialized boost_fd.
Change-Id: Icf209e2e0f4835db01f61dbf83b4715db9ef03a9
(cherry picked from commit def6c151f4)
2016-02-25 23:53:08 +00:00
Mark Salyzyn 1d5afc9e08 liblog: add android_log_write_string8_len
(cherry pick from commit 67d7eafd56)

android_log_write_string8_len(android_log_context ctx,
                              const char *value, size_t maxlen)

Caps the supplied string to a maxlen length. Alter API to handle
a NULL pointer for the value string for this and
android_log_write_string8() and instead of returning -EINVAL,
act like a null string "" was supplied to preserve the list
location. API is also changed to report the number of characters
actually placed into the android_log_context.

Bug: 27356456
Bug: 19235719
Change-Id: I6a03d405eac1d741555dd05555513ec691e7a46e
2016-02-25 15:53:00 -08:00
Christopher Ferris 82d84897b1 Fix incorrect handling of snprintf return value.
The code assumed that snprintf would never return a value less than
the passed in size of the buffer. This is not accurate, so fix all
of the places this assumptions is made. Also, if the name is too large,
then truncate just the name to make everything fit.

Added a new set of tests for this code. Verified that the old code passes
on the _normal and _exact version of the tests, but fails with the
FORTIFY error on the _truncated version of the tests. All tests pass
on the new code.

Bug: 27324359

(cherry picked from commit 626efb78a6)

Change-Id: Iba60a926cf5a1d6b517a6bfd8c797d724f093010
2016-02-25 14:02:00 -08:00
Dimitry Ivanov aa2cf3facf Merge "Make libutils symbols protected" into nyc-dev 2016-02-25 21:08:48 +00:00
Mark Salyzyn d26b2cacad logd: sock_alloc_send_pskb starves pruning
(cherry pick from commit 5c77ad55d0)

Allow socket send syscall to terminate after 32 seconds if reader
stalled because of memory pressure allocating new network buffers

Add a gTest to catch regressions, add security buffer to log_dump

Bug: 27242723
Change-Id: Idaa6699d9d284e7f5f723ae0e76b3d6aa3371489
2016-02-25 12:43:12 -08:00
Mark Salyzyn 317bfb923c logd: Allow (some) headers to be individually importable
(cherry pick from commit 2ad0bd0a9b)

LogReader.h needs to be individually importable.

Fix a few others, drop includes of local includes, let them be
included in source instead and allow headers to be included
alphabetically. Was not a complete audit since goal was to
separate LogReader.h out from the pack.

Bug: 27242723
Change-Id: Ic7759ef90995e5bd285810706af33550c73cf5b5
2016-02-25 12:42:31 -08:00
Ruchi Kandoi df09aefc16 Merge "healthd: Read the max power supply voltage" into nyc-dev 2016-02-25 20:28:19 +00:00
Alex Klyubin 8a67c09e7d Merge "Only debuggable packages can be downgraded." into nyc-dev 2016-02-25 20:26:54 +00:00
Badhri Jagan Sridharan 40e1df4488 healthd: Read the max power supply voltage
With Type-C PD, VBUS can no longer be assumed to
to be at 5V. Read the "voltage_max" field from the
power_supply class node and export it through
BatteryProperties service.

Bug: 25229483
Change-Id: I04e32d9783a21bab375f1724758a9eeace2a047c
2016-02-25 12:15:54 -08:00
Dimitry Ivanov 2c7960c8d9 Make libutils symbols protected
This change is a workaround for apps linking
libutils statically and dynamically which causes
them to crash for newer version of Android.

Bug: http://b/27313399
Change-Id: I47ac4146041b6eeef03cb605ea436719d552ec8f
2016-02-25 11:44:35 -08:00
Dimitry Ivanov d047c925af Added function to explicitly initialize a namespace
This change replaces lazy get-or-create logic for
linker namespaces with the explicit one.

ApplicationLoaders.getClassLoader(..) is now resposible for
the namespace initialization for PathClassLoaders.

Bug: http://b/27189432
Bug: http://b/22548808
Change-Id: Ife987c3ca1db33a47c20f363a5ed61512be8b5a7
2016-02-25 11:33:32 -08:00
Josh Gao 2eaa41a6df adb: fix leak of framework_fd.
Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.

Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
(cherry picked from commit 9f48611554)
2016-02-25 11:01:59 -08:00
Josh Gao b6117c4397 adb: bail out if wait_for_device fails in send_shell_command.
Bug: http://b/27166186
Change-Id: Ib7e9d7e6b909d67a3af94c3517a6a0b54cf17db7
(cherry picked from commit f56c39194f)
2016-02-25 11:01:38 -08:00
Lorenzo Colitti b046e74bef Merge "Delete dhcpcd code in system/core, since dhcpcd is no more." into nyc-dev 2016-02-25 07:56:16 +00:00
Lorenzo Colitti 9c07eb9dd8 Delete dhcpcd code in system/core, since dhcpcd is no more.
Bug: 27192644
Change-Id: I44c2ded2da69395f12a8850b2677322b11c2cb91
2016-02-25 16:04:43 +09:00
Nick Kralevich 53e56b9473 Merge "init: harden socket creation against symlinks" into nyc-dev 2016-02-25 06:47:11 +00:00
James Hawkins 1f1b327923 Merge "bootstat: Record the time since factory reset on init." into nyc-dev 2016-02-25 00:49:07 +00:00
Alex Klyubin 85ed97518c Only debuggable packages can be downgraded.
This reflects the change in PackageManager service:
frameworks/base commit 921dd754ab49df0cd580ff96503f7616c4c85f4a.

Bug: 27327503
Change-Id: Ifcc7268cd271640417b8cfc9db81ea954b491cb1
2016-02-24 16:07:47 -08:00
Nick Kralevich ab5629c197 init: harden socket creation against symlinks
Instead of using chown, use the symlink safe lchown.

Instead of using chmod, use the symlink safe fchmodat
with AT_SYMLINK_NOFOLLOW.

Fix a bug where the SELinux filesystem creation context may
not be restored, and some memory not freed, if bind() fails.

Check the return values from the chown/chmod calls and unlink
the files if it ever fails.

Bug: 27337831
Change-Id: I3343786f5a4eefda7bbb8317f2eca16bd21003c0
2016-02-24 15:50:52 -08:00
Lajos Molnar 88a5ad3f13 keep legacy HAL_DATASPACE enums unchanged
Bug: 25975353
Change-Id: I092b568420aa605425c12de9b245bca7ed602f43
2016-02-24 15:36:57 -08:00
Dimitry Ivanov 426799d770 Add PreloadPublicNativeLibraries function
Shift responsibility of preloading native libraries to the user
of the library. This lets applications that do not use jni but
depend on libnative_loader.so to avoid unnecessary preloads of
public libraries which could be expensive.

Bug: http://b/27245894
Change-Id: I12a8100de5da639c068769bca21ecebff2b2d538
2016-02-24 23:30:27 +00:00
Josh Gao b236ff7156 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours am: 8a7a944fd3 am: aa0afa65c5 am: 77afd98582
am: 8e3e7e9f97  -s ours

* commit '8e3e7e9f97867a2e35e91c3c8733f86d5b387f4d':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:34:55 +00:00
Josh Gao 8e3e7e9f97 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours am: 8a7a944fd3 am: aa0afa65c5
am: 77afd98582

* commit '77afd985829024a00aef82f0fb1533a6d4294359':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:28:03 +00:00
Josh Gao ab4ce73702 resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b am: 92e0f8f49d am: 65f7b2d616 am: f25e2dfd3f
am: 3ddc5e7d6d

* commit '3ddc5e7d6db27925a4f87fdbcb60eebd16e65952':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:27:55 +00:00
Dan Willemsen fea11c4d1b Merge "Remove duplicate fdevent.cpp entry" into nyc-dev 2016-02-24 22:23:51 +00:00
Josh Gao 77afd98582 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours am: 8a7a944fd3
am: aa0afa65c5

* commit 'aa0afa65c573cbc30ed6afb795b27b12a2f29b31':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:21:02 +00:00
Josh Gao 3ddc5e7d6d resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b am: 92e0f8f49d am: 65f7b2d616
am: f25e2dfd3f

* commit 'f25e2dfd3f441b6cfbee30a18bb5507dee28349a':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:20:48 +00:00
Josh Gao aa0afa65c5 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3 am: 512b191d80 -s ours
am: 8a7a944fd3

* commit '8a7a944fd399dc7f9475b7cc2e06681516156e39':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:14:53 +00:00
Josh Gao f25e2dfd3f resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b am: 92e0f8f49d
am: 65f7b2d616

* commit '65f7b2d6169a2a61fe1d607ca55e690721faf31a':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:14:05 +00:00
Josh Gao 65f7b2d616 resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b am: c663d0482b
am: 92e0f8f49d

* commit '92e0f8f49d952b365b2be7715a4320d2451d7a67':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 22:06:23 +00:00
Josh Gao 8a7a944fd3 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours am: 75708e52d3
am: 512b191d80  -s ours

* commit '512b191d80f01f514789b33d44b64534708ede51':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 22:06:23 +00:00
Josh Gao 512b191d80 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2 am: 9cde309103 -s ours
am: 75708e52d3

* commit '75708e52d3cced48b4726e71ac94f17cd013ee98':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:59:29 +00:00
Josh Gao 92e0f8f49d resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392 am: b97b07e55b
am: c663d0482b

* commit 'c663d0482b67d028e5b30dbe5f45ef7da2b3e5de':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:59:21 +00:00
Josh Gao c663d0482b resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5 am: 7e10520392
am: b97b07e55b

* commit 'b97b07e55b4ef4312870398bf658b30b41103403':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:52:52 +00:00
Josh Gao 75708e52d3 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours am: 1eb6ec56c2
am: 9cde309103  -s ours

* commit '9cde3091033bc367690aa65b814650cdc0e284fe':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:46:12 +00:00
Josh Gao b97b07e55b resolve merge conflicts of 9515c23e16 to klp-modular-dev am: 91b48c3796 -s ours am: adc3bcb1d5
am: 7e10520392

* commit '7e105203923041986a1bd125d86495663fee3abf':
  debuggerd: use O_NOFOLLOW|O_CLOEXEC for tombstones. DO NOT MERGE
2016-02-24 21:37:04 +00:00
Josh Gao 9cde309103 resolve merge conflicts of 557749e55b to klp-modular-dev DO NOT MERGE am: bdfb431467 -s ours
am: 1eb6ec56c2

* commit '1eb6ec56c28aae79dadb62e63e245745fe9485a1':
  Don't create tombstone directory. DO NOT MERGE
2016-02-24 21:36:59 +00:00