Commit graph

20209 commits

Author SHA1 Message Date
Andres Morales
95989dbb0f trusty: add keymaster module
Change-Id: Id240b1b33e07d4cb3ea9d188014701e3d2b3c477
2016-05-02 15:12:01 -07:00
Andres Morales
1571f47f3c trusty: add gatekeeper module
Change-Id: I3e468c103326e6a9147dbed6c803748ffd5e207a
2016-05-02 15:12:01 -07:00
Dimitry Ivanov
27d75e8bc1 Merge "nativeloader: Add Reset capabilities" 2016-05-02 21:31:49 +00:00
Dimitry Ivanov
911472da85 nativeloader: Add Reset capabilities
In the case when VM is restarted all weak references
from the old VM become invalid. In such event NativeLoader
needs to clear the list of classloaders from old VM.

Bug: http://b/28453840
Bug: http://b/28449304
Change-Id: I2268c1e21cf940c57ddc5f0312f56b71aa702134
(cherry picked from commit be4ca3afc0)
2016-05-02 13:35:32 -07:00
Elliott Hughes
bfd6a0f24d Merge "Remove useless #include." 2016-04-30 17:56:26 +00:00
Elliott Hughes
c4248ae9a1 Remove useless #include.
Bug: http://b/28432688
Change-Id: I8982f42b2bf2305168a4ba167e422173f35c69c2
2016-04-30 09:10:07 -07:00
Elliott Hughes
b9ce0f10f3 Merge "toolbox ps: replace strcpy with snprintf." 2016-04-30 16:07:10 +00:00
Elliott Hughes
defd249d3d toolbox ps: replace strcpy with snprintf.
Change-Id: I0fdf9a8d5ab15bcff06cca3f3e7024ab76b219d9
2016-04-29 22:10:40 -07:00
Chih-hung Hsieh
7bdd6a8b5a Merge "Fix google-explicit-constructor warnings." 2016-04-30 05:10:05 +00:00
Treehugger Robot
3b9ba98e9e Merge changes Ied2ab927,I16245af7
* changes:
  Silently ignore duplicate heap entries
  Handle segfaults while walking native heap
2016-04-29 23:16:39 +00:00
Chih-Hung Hsieh
1c563d96f0 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-04-29 15:44:04 -07:00
Colin Cross
583a250830 Silently ignore duplicate heap entries
Vendor blobs on ryu mprotect heap pages, causing a single chunk mapping
to appear as multiple mappings.  The heap iterator has to expand the
requested range to cover the beginning of the chunk to find the chunk
metadata, which will lead to duplicate identical allocations being
reported from iterating over each of the split mappings.  Silently
ignore identical allocations, and only warn on non-identical allocations
that overlap.

Bug: 28269332
Change-Id: Ied2ab9270f65d00a887c7ce1a93fbf0617d69be0
(cherry picked from commit cecd64012d)
2016-04-29 15:14:06 -07:00
Colin Cross
0965c0247b Handle segfaults while walking native heap
Vendor blobs on ryu mprotect heap pages, causing segfaults when dumping
unreachable memory.  Handle segfaults within HeapWalker by mapping a
zero page over any unreadable pages.  HeapWalker runs in the forked
process, so the mapping will not affect the original process.

Bug: 28269332
Change-Id: I16245af722123f2ad467cbc6f245a70666c55544
(cherry picked from commit ba5d9ff6d9)
2016-04-29 15:14:06 -07:00
Treehugger Robot
7da38d6cb4 Merge "logcat: confirm -g result after -c" 2016-04-29 20:07:22 +00:00
Treehugger Robot
2123c6fc30 Merge "Add empty <util.h> to build BSD source." 2016-04-29 19:46:43 +00:00
Elliott Hughes
36abd48c6a Add empty <util.h> to build BSD source.
Hopefully this will let us remove the empty file from bionic. It shouldn't
be there because -- unlike BSD -- we don't actually have a libutil.

Change-Id: I7e3042ca120aafa877709797866b52ac62675870
2016-04-29 11:53:29 -07:00
Mark Salyzyn
e7e5f1b6ae logcat: confirm -g result after -c
Bug: 28451229
Change-Id: I43a1721ae991cc1316335ba4b3b868b904926d42
2016-04-29 11:33:26 -07:00
Elliott Hughes
17f3b1bad7 Merge "Use more std::string in fastboot." 2016-04-29 17:47:30 +00:00
Treehugger Robot
fc80b22752 Merge "liblog: O_CLOEXEC flag on opens" 2016-04-29 15:35:12 +00:00
Elliott Hughes
2810d00dd9 Use more std::string in fastboot.
Change-Id: Ic8c77eac1e0088627ab650050d9c97c5749e5c39
2016-04-29 08:30:13 -07:00
Mark Salyzyn
78786da116 liblog: O_CLOEXEC flag on opens
Bug: 28455828
Change-Id: Ic00101a6192aab7271cb0c3461e249a77d7f29ed
2016-04-29 07:52:36 -07:00
Mark Salyzyn
7f18790bd7 Merge "liblog: logcat -g readable size wrong" 2016-04-29 14:44:03 +00:00
Mark Salyzyn
ccfb244b36 liblog: logcat -g readable size wrong
Bug: 28451229
Change-Id: I4bbc2bed933d69416c23cc7af617be3fb55d0b62
2016-04-29 07:39:51 -07:00
Treehugger Robot
94b0f3763f Merge "ueventd: relabel block devices nodes when processing subsequent add events" 2016-04-28 12:04:24 +00:00
Mihai Serban
24a3cbfa73 ueventd: relabel block devices nodes when processing subsequent add events
There is a race in ueventd's coldboot procedure that permits creation
of device block nodes before platform devices are registered. This happens
when the kernel sends events for adding block devices during ueventd's
coldboot /sys walk.
In this case the device node links used to compute the SELinux context
are not known and the node is created under the generic context:
u:object_r:block_device:s0.
A second add event for block device nodes is triggered after the platform
devices are handled by ueventd and the SELinux context is correctly computed
but the mknod call fails because the node already exists. This patch handles
this error case and updates the node's security context.

The race is introduced by the uevent sent from the sdcard device probe
function. The issue appears when this uevent is triggered during ueventd's
coldboot procedure but before the /sys/devices recursive walk reached the
corresponding sdcard platform device path.
The backtrace looks something like:
1. ueventd_main()
2. device_init()
3. coldboot("/sys/devices");
4. do_coldboot()
5. handle_device_fd()
6. handle_device_event()
6.1 handle_block_device_event()
6.2 handle_platform_device_event()

Because handle_device_fd() reads all events from the netlink socket it may
handle the add events for the sdcard partition nodes send occasionally by the
kernel during coldboot /sys walk procedure.
If handle_device_event() continues with handle_block_device_event()
before handle_platform_device_event() registers the sdcard platform device then
handle_block_device_event() will create device nodes without knowing all block
device symlinks (get_block_device_symlinks()):
1. handle_device(path=/dev/block/mmcblk0p3, links = NULL)
2. make_device(path=/dev/block/mmcblk0p3, links = NULL)
3. selabel_lookup_best_match(path=/dev/block/mmcblk0p3, links = NULL)
  returns the default context (u:object_r:block_device:s0) for
  /dev/block/mmcblk0p3 instead of more specific context like:
  u:object_r:boot_block_device:s0
4. setfscreatecon(u:object_r:block_device:s0)
5. mknod(/dev/block/mmcblk0p3)

So the node is create with the wrong context. Afterwards the coldboot /sys walk
continues and make_device() will be called with correct path and links.
But even if the secontext is computed correctly this time it will not be
applied to the device node because mknod() fails.
I see this issue randomly appearing (one time in 10 reboots) on a Minnoboard
Turbot with external sdcard as the boot device.

BUG=28388946

Change-Id: I96e239af29d82b753e5d349b3ecefaad09edee87
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
2016-04-28 10:45:03 +00:00
Treehugger Robot
3abd03232e Merge "Change remaining Android logging macros to use C99 varidaic syntax" 2016-04-27 22:39:20 +00:00
Alex Vakulenko
3b0d65ad10 Change remaining Android logging macros to use C99 varidaic syntax
Most of the system/core/include/log/log.h file uses the C99 syntax of
variadic macros (that is, '...' in parameter list and __VA_ARGS__
in arguments). Except for andoid_printLog and android_printAssert
which still uses GCC custom extension syntax.

Switched the remaining macros to use C99 syntax. GCC extension syntax
makes my editor's code parser puke.

BUG: None
Change-Id: Ia6ebc0f2044b64182c425b179da0229c7046be4a
2016-04-27 14:44:40 -07:00
Dimitry Ivanov
6d28ae7b0d Merge "native_loader: Use ANDROID_ROOT environment variable" 2016-04-27 18:24:33 +00:00
Dimitry Ivanov
581beebc98 Merge "Enable namespaces for all target sdk versions" 2016-04-27 18:24:04 +00:00
Treehugger Robot
bf1767fbed Merge "Fix google-explicit-constructor warnings." 2016-04-27 15:44:07 +00:00
Treehugger Robot
c2964402b6 Merge "adb: decrease the number of fds used in fd_count test." 2016-04-26 23:55:11 +00:00
Josh Gao
858f133d41 adb: decrease the number of fds used in fd_count test.
Default limit is 1024 fds, which means 512 socketpairs will hit the
limit.

Bug: http://b/28386497
Change-Id: Ib36404c050e4be3db51378e250f300f7ec5aab13
2016-04-26 15:45:23 -07:00
Treehugger Robot
52eb6025ed Merge "adb: fix test_device.py shell protocol checks." 2016-04-26 21:35:55 +00:00
Treehugger Robot
6b617c7c30 Merge "Don't hardcode gtest paths." 2016-04-26 21:19:51 +00:00
David Pursell
cf46741b4f adb: fix test_device.py shell protocol checks.
https://android-review.googlesource.com/#/c/210646/ added a
has_shell_protocol() function but the test_device.py tests were still
trying to use the now-missing SHELL_PROTOCOL_FEATURE constant.

This CL just switches test_device.py to correctly use the
has_shell_protocol() method.

Change-Id: Ie0a2f0dc07529843d25051a01e08fb677551a4e1
Test: `python -m unittest discover -v` on devices with and without
      the shell protocol.
2016-04-26 13:29:39 -07:00
Dan Albert
3df8c67d29 Don't hardcode gtest paths.
Bug: http://b/16574165
Change-Id: Icaf99a51c309db7eb5f8b051a5896b5f49e1b3bc
2016-04-26 13:28:23 -07:00
Treehugger Robot
64461c293c Merge "sdcard: avoid benign unsigned overflow" 2016-04-26 17:10:49 +00:00
Daniel Micay
df9c4a0166 sdcard: avoid benign unsigned overflow
Change-Id: Id9427b4e01602bba31f8958b8d491b092b31482b
2016-04-26 12:08:46 -04:00
Jorge Lucangeli Obes
58505e17bb Merge "Fix 'ps.c' formatting." 2016-04-26 03:39:53 +00:00
Yabin Cui
e998abde89 Merge "adb: fix socket tests." 2016-04-26 03:00:15 +00:00
Yabin Cui
2407d7c3d9 adb: fix socket tests.
Bug: 28386497

Change-Id: I9f37ecadf3cfc6bb4e5da502d40f49e1f3a16d8a
2016-04-25 19:51:58 -07:00
Chih-hung Hsieh
e1d5c2548b Merge "Fix google-explicit-constructor warnings." 2016-04-26 00:36:31 +00:00
Jorge Lucangeli Obes
5c1b3afbd4 Fix 'ps.c' formatting.
Insert a space between 'if'/'while' and their clause.
Also insert a space after ',' for arguments.

This was done with clang-format.

Bug: None

Change-Id: I5315eba3d5d8ac68996a373dc7c8e1bc45165824
2016-04-25 16:31:15 -07:00
Jorge Lucangeli Obes
47f808d09f Merge "Fix 'ps --ppid'." 2016-04-25 23:21:56 +00:00
Jorge Lucangeli Obes
c5e7f73bc6 Fix 'ps --ppid'.
Currently, 'ps' will segfault when called with '--ppid' and no argument.
Make it return an error instead.

Bug: 28383024

Change-Id: I71f2d1ba9502996ae75b17605234eb99ebb589f2
2016-04-25 15:54:12 -07:00
Chih-Hung Hsieh
75935ef67e Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I0ce541f79feef5c08eac64edc686be3edf9c2aa4
2016-04-25 15:28:36 -07:00
Chih-hung Hsieh
f9660191f0 Merge "Fix google-explicit-constructor warnings." 2016-04-25 22:22:06 +00:00
Chih-Hung Hsieh
3a114e0a81 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I5d1988efc1563efbdb25c867713c54f41439a82a
2016-04-25 14:57:11 -07:00
Elliott Hughes
d2afbe45e1 Merge "GCC compiler warning fix for sprintf into snprintf" 2016-04-25 20:58:04 +00:00
Chih-Hung Hsieh
1cc82ce95c Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I2cf746fd07addc6e6c22e98e2a5bb8a8ce47c885
2016-04-25 13:49:46 -07:00