Commit graph

36324 commits

Author SHA1 Message Date
Josh Gao
151c4adb28 Merge "adb: improve CHECKs." am: 9f38e19b88 am: f628362478
am: 3c186bc32c

Change-Id: I4c30f4f9cd8ac92f38e6640a747227211e7fe528
2017-08-28 23:49:54 +00:00
Josh Gao
3c186bc32c Merge "adb: improve CHECKs." am: 9f38e19b88
am: f628362478

Change-Id: I4d381032b4dfbca95a203473af4fcc6164b1fca8
2017-08-28 23:46:24 +00:00
Josh Gao
f628362478 Merge "adb: improve CHECKs."
am: 9f38e19b88

Change-Id: Icc50ced0faeda5653288922ec787311e30c5085d
2017-08-28 23:40:23 +00:00
Treehugger Robot
9f38e19b88 Merge "adb: improve CHECKs." 2017-08-28 23:35:44 +00:00
Tom Cherry
2235fa414f Merge "init: fix signal handling and LOG(FATAL) in child processes" am: 30bf4b7500 am: 43e92299e9
am: 5727a169c1

Change-Id: I7dd7729df2b1073946b7a9a350e528a95eed72fd
2017-08-28 22:05:17 +00:00
Tom Cherry
5727a169c1 Merge "init: fix signal handling and LOG(FATAL) in child processes" am: 30bf4b7500
am: 43e92299e9

Change-Id: I1df0e8ced15a283cccda88f24ebcfcb33b23c3c3
2017-08-28 22:01:16 +00:00
Tom Cherry
43e92299e9 Merge "init: fix signal handling and LOG(FATAL) in child processes"
am: 30bf4b7500

Change-Id: I9147d02a9e710f9e8068a9b3b061768daf2648e9
2017-08-28 21:55:45 +00:00
Tom Cherry
30bf4b7500 Merge "init: fix signal handling and LOG(FATAL) in child processes" 2017-08-28 21:45:38 +00:00
Josh Gao
e46720938d adb: improve CHECKs.
Use CHECK_LT(foo, 1234) instead of CHECK(foo < 1234) so that failing
checks have the values emitted.

Bug: http://b/65063965
Test: adb server nodaemon
Change-Id: I094287f7c4d2d177ea216568d06e9e425a28dd96
2017-08-28 14:43:24 -07:00
Josh Gao
ca5f86e084 Merge "adbd: don't spin if file sync read fails." am: 32d2eae8b9 am: 4dc1892491
am: 43898a6add

Change-Id: Icc7d13bc5e7ff2aaf63f95f046734fb77db6d72e
2017-08-28 21:26:43 +00:00
Josh Gao
43898a6add Merge "adbd: don't spin if file sync read fails." am: 32d2eae8b9
am: 4dc1892491

Change-Id: If487706ed52943b8034334146286026ddbc5535a
2017-08-28 21:21:15 +00:00
Josh Gao
4dc1892491 Merge "adbd: don't spin if file sync read fails."
am: 32d2eae8b9

Change-Id: Ie104bb8ea8d67b5a7ce896d2237a44cc8ea1ab4f
2017-08-28 21:16:13 +00:00
Treehugger Robot
32d2eae8b9 Merge "adbd: don't spin if file sync read fails." 2017-08-28 21:06:48 +00:00
Tom Cherry
d0f3e414a0 Merge "init: support setting rlimits per service" am: 459aa1cac6 am: c39a5082dc
am: d47ccf8277

Change-Id: I29a5baea3ba8193724fc94a57cf1d770a9a46d62
2017-08-28 19:52:07 +00:00
Tom Cherry
d47ccf8277 Merge "init: support setting rlimits per service" am: 459aa1cac6
am: c39a5082dc

Change-Id: I1f302dccc0f93c61da8d1d7df99d7086ce33ed20
2017-08-28 19:45:40 +00:00
Tom Cherry
c39a5082dc Merge "init: support setting rlimits per service"
am: 459aa1cac6

Change-Id: I4ef5abc3371ce52783bfb14669bcffe33febb73e
2017-08-28 19:39:08 +00:00
Treehugger Robot
459aa1cac6 Merge "init: support setting rlimits per service" 2017-08-28 19:27:08 +00:00
Josh Gao
1d6c01b53d adbd: don't spin if file sync read fails.
Bug: http://b/64508974
Test: mma
Change-Id: Ifba6a9dea3138b6d2a62c91cc0532f63986c048a
2017-08-28 11:21:31 -07:00
Tom Cherry
487378ae14 Merge "init: log all failures of Service::Start()" am: 9bde0dc769 am: 849b481786
am: fb32e15da8

Change-Id: Ie658e3036ea452e4d93a8e947d860040fc7cce5d
2017-08-28 17:40:29 +00:00
Tom Cherry
fb32e15da8 Merge "init: log all failures of Service::Start()" am: 9bde0dc769
am: 849b481786

Change-Id: Ia6fc0b0917d6b35dda5270c9fa416fb46a6743ed
2017-08-28 17:36:00 +00:00
Tom Cherry
849b481786 Merge "init: log all failures of Service::Start()"
am: 9bde0dc769

Change-Id: Ibb27338bb694482108ffc558b2823c583a9701d3
2017-08-28 17:30:28 +00:00
Tom Cherry
9bde0dc769 Merge "init: log all failures of Service::Start()" 2017-08-28 17:22:11 +00:00
Tom Cherry
7ac013de7e init: support setting rlimits per service
Add a new service option, `rlimit` that allows a given rlimit to be
set for a specific service instead of globally.

Use the same parsing, now allowing text such as 'cpu' or 'rtprio'
instead of relying on the enum value for the `setrlimit` builtin
command as well.

Bug: 63882119
Bug: 64894637

Test: boot bullhead, run a test app that attempts to set its rtprio to
      95, see that the priority set fails normally but passes when
      `rlimit rtprio 99 99` is used as its service option.
      See that this fails when `rlimit rtprio 50 50` is used as well.
Test: new unit tests

Change-Id: I4a13ca20e8529937d8b4bc11718ffaaf77523a52
2017-08-28 10:19:50 -07:00
Nick Kralevich
566ae3ebf6 Merge "init.rc: Lock down access to /proc/net/fib_trie" into oc-mr1-dev
am: c3090ba2f4

Change-Id: I9ffa9c76b807c8439f05388f4b8aae3d131bac5a
2017-08-28 14:42:49 +00:00
TreeHugger Robot
c3090ba2f4 Merge "init.rc: Lock down access to /proc/net/fib_trie" into oc-mr1-dev 2017-08-28 14:36:02 +00:00
Robert Benea
096d8034a6 Merge "Detect critical preassure" into oc-mr1-dev
am: 719e71095f

Change-Id: I9681c7be43342189702b6a9c5d564ca21dc371bd
2017-08-27 19:59:17 +00:00
Robert Benea
719e71095f Merge "Detect critical preassure" into oc-mr1-dev 2017-08-27 19:52:48 +00:00
Christopher Ferris
fcede542f2 Merge "Add missing include for readv." am: 1f6a807bac am: 831140358d
am: 4c4b8edb19

Change-Id: Ib5f0f4b99a0775329ec12130b84cf68997fe2008
2017-08-26 15:25:15 +00:00
Christopher Ferris
4c4b8edb19 Merge "Add missing include for readv." am: 1f6a807bac
am: 831140358d

Change-Id: I06445320fb9ec382af117612cb64e9c35949ef00
2017-08-26 15:22:14 +00:00
Christopher Ferris
831140358d Merge "Add missing include for readv."
am: 1f6a807bac

Change-Id: Ib0530b4e3ea1a9fdc779c87cdd12489859a35bff
2017-08-26 15:19:14 +00:00
Christopher Ferris
1f6a807bac Merge "Add missing include for readv." 2017-08-26 15:12:14 +00:00
Robert Benea
c47f2992b5 Detect critical preassure
When close to oom the system tend to become very thrashy
and keeps paging. This change looks at the current working sent and
checks it against swap.

Test: tested on gobo
Bug: 64721547

Change-Id: I93d42def93cbc03a01a54988fd5286ec9f124e36
2017-08-25 19:01:54 -07:00
Christopher Ferris
5d6a0325ef Add missing include for readv.
Test: Builds.
Change-Id: Ia8511dcec6f49d3f6016a4dac88ccf343495349b
2017-08-25 17:33:38 -07:00
Josh Gao
5230437a42 Merge "libunwindstack: make machine type a property of Regs." am: 75a40988c0 am: 310f3e114a
am: dca8180110

Change-Id: Idcb72287f5dd8a822614fe53d253b6b919b88a1d
2017-08-26 00:24:15 +00:00
Josh Gao
dca8180110 Merge "libunwindstack: make machine type a property of Regs." am: 75a40988c0
am: 310f3e114a

Change-Id: I319cbb0ca2bbb569f7c8e989764243825a0cdeea
2017-08-26 00:19:10 +00:00
Josh Gao
310f3e114a Merge "libunwindstack: make machine type a property of Regs."
am: 75a40988c0

Change-Id: I237904de44d478b03b74dda42f1b6a6ce5c36aa0
2017-08-26 00:15:22 +00:00
Treehugger Robot
75a40988c0 Merge "libunwindstack: make machine type a property of Regs." 2017-08-26 00:02:46 +00:00
Nick Kralevich
44836221c6 Merge "Clarify SELinux service error message" am: 54a28300b7 am: 706a898cd0
am: 787b5038f4

Change-Id: Ifcc645d820701368e65d8701fcacaf581b5c660d
2017-08-25 23:20:47 +00:00
Nick Kralevich
787b5038f4 Merge "Clarify SELinux service error message" am: 54a28300b7
am: 706a898cd0

Change-Id: I3ab507e09016b94efb1440a4ad77a03918d361a5
2017-08-25 23:18:46 +00:00
Nick Kralevich
706a898cd0 Merge "Clarify SELinux service error message"
am: 54a28300b7

Change-Id: I638bad81212c20b1c0065eab98ab2e043b643aac
2017-08-25 23:16:47 +00:00
Treehugger Robot
54a28300b7 Merge "Clarify SELinux service error message" 2017-08-25 23:10:06 +00:00
Tom Cherry
1ca83249a1 init: fix signal handling and LOG(FATAL) in child processes
Child processes inherit the signal handlers and the 'Aborter' for
logging from their parent process.  In the case of init, fork()'ed
processes, will attempt to reboot the system if they receive a fatal
signal or if they call LOG(FATAL).  This is not the correct behavior;
these processes should terminate due to the provided signal like other
processes on the system.

This is particularly important as there are multiple LOG(FATAL) calls
in service.cpp for failures after fork() but before execv() when a
service is started.

Note, that pthread_atfork() is not a viable solution since clone() is
used in some cases instead of fork() and atfork handlers are not
called with clone().

Test: LOG(FATAL) from a child process of init and see that it
      terminates due to a signal correctly
Test: LOG(FATAL) from init proper and see that it reboots to the
      bootloader

Change-Id: I875ebd7a5f6b3f5e3e2c028af3306917c4409db3
2017-08-25 15:10:48 -07:00
Josh Gao
0953ecd03a libunwindstack: make machine type a property of Regs.
There are no actual users of the machine type output parameter to
Regs::RemoteGet. The concrete implementations of Regs know what machine
type they represent anyway, so provide an accessor to query.

Test: treehugger
Test: libunwindstack tests on 32/64-bit host, hikey960
Change-Id: Ia25910531d36c41b2b6919f154cfa914aae63117
2017-08-25 14:48:09 -07:00
Nick Kralevich
1ea19eb44d Clarify SELinux service error message
1) Attempt to make the error message associated with a missing service
better.
2) Provide a link to more in-depth documentation.

Bug: 65023716
Test: code compiles.
Change-Id: Ie0f1896fb41d5afd11501f046cb51d4c8afe0a62
2017-08-25 14:01:06 -07:00
Nick Kralevich
15ffc53f6d init.rc: Lock down access to /proc/net/fib_trie
Make /proc/net/fib_trie only readable to root.

Bug: 31269937
Test: Device boots, file has appropriate permissions.
Change-Id: I0d01ce5c043d576344a6732b0b9ff93d62fcaa34
2017-08-25 12:55:52 -07:00
Christopher Ferris
317764f2f5 Merge "Speed up map creation." am: df3e89be94 am: 2bf9cbf233
am: bd048209b4

Change-Id: If598ef3d52cdc8d383d0a188c8e058cf1c51441f
2017-08-25 19:21:01 +00:00
Christopher Ferris
bd048209b4 Merge "Speed up map creation." am: df3e89be94
am: 2bf9cbf233

Change-Id: I1298f1c8b9e7ee6abad624513be5c365389804f7
2017-08-25 19:16:30 +00:00
Christopher Ferris
2bf9cbf233 Merge "Speed up map creation."
am: df3e89be94

Change-Id: Iba6f292a4448f065dcf64c6f3e40107b5042a62d
2017-08-25 19:12:29 +00:00
Christopher Ferris
df3e89be94 Merge "Speed up map creation." 2017-08-25 19:04:14 +00:00
Tom Cherry
702ca9ada2 init: log all failures of Service::Start()
The move to returning Result from Service::Start() for better context
when starting process through init's builtins stops Service::Start()
failures from being logged from other contexts.  This change adds
those logs along with their context.

Test: boot bullhead, fail to start services via `setprop ctl.start`,
      see the expected error in dmesg

Change-Id: I45294f6abf00852f3d4c549a32eaf4920a51e6f0
2017-08-25 11:01:52 -07:00