<feed xmlns='http://www.w3.org/2005/Atom'>
<title>system_core/llkd, branch replicant-10</title>
<subtitle>Fork of system/core
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/'/>
<entry>
<title>llkd: do not call sync()</title>
<updated>2019-01-10T20:52:35+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2019-01-09T15:49:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=16649d22ca639b14bd7fd831cfa8ce6855ad1d70'/>
<id>16649d22ca639b14bd7fd831cfa8ce6855ad1d70</id>
<content type='text'>
sync() will never return if the io subsystem is locked up, drop it.

Test: llkd_unit_test
Bug: 122263600
Change-Id: Ib378124415ce94da987d73391b027dc10317dbe9
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
sync() will never return if the io subsystem is locked up, drop it.

Test: llkd_unit_test
Bug: 122263600
Change-Id: Ib378124415ce94da987d73391b027dc10317dbe9
</pre>
</div>
</content>
</entry>
<entry>
<title>llkd: handle 'adbd shell setsid' to preserve adbd</title>
<updated>2019-01-04T21:49:48+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2019-01-02T16:27:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=da2aeb0c42fee80c02227adb73c0f246bf5f7089'/>
<id>da2aeb0c42fee80c02227adb73c0f246bf5f7089</id>
<content type='text'>
A zombie setsid process occurs when adb shell setsid &lt;command&gt; is
issued, however llkd can only detect if it is a result of a kernel
livelock by killing the associated parent, which would be adbd;
resulting in the adb connection(s) being terminated.  Will special
case this condition in order to preserve adbd for debugging purposes.

We parse &lt;parent&gt;&amp;&lt;child&gt; in ro.llk.blacklist.parent as this
association, thus adbd&amp;[setsid] covers this special case.
Ampersand was selected because it is never part of a process name,
however a setprop in the shell requires it to be escaped or quoted;
init rc file where this is normally specified does not have issue.

getComm() is effectively pure, so hold on to the return value for
sake of efficiency.

This also reverts commit 599958d1148c1137bee925f4cf08eda7f8050d98
which granted adbd blanket parent immunity from monitoring on
userdebug builds.  The new logic is a more refined means of
preserving the live lock checking associated with adbd and allows
the operation to be performed on user builds.

POC: date ; adb shell setsid sleep 900 ; date
Positive for bug, reports less than 15 minutes, otherwise solved.

Test: llkd_unit_test
Bug: 120983740
Change-Id: I6442463a48499d925a3a074423a24a1622905559
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A zombie setsid process occurs when adb shell setsid &lt;command&gt; is
issued, however llkd can only detect if it is a result of a kernel
livelock by killing the associated parent, which would be adbd;
resulting in the adb connection(s) being terminated.  Will special
case this condition in order to preserve adbd for debugging purposes.

We parse &lt;parent&gt;&amp;&lt;child&gt; in ro.llk.blacklist.parent as this
association, thus adbd&amp;[setsid] covers this special case.
Ampersand was selected because it is never part of a process name,
however a setprop in the shell requires it to be escaped or quoted;
init rc file where this is normally specified does not have issue.

getComm() is effectively pure, so hold on to the return value for
sake of efficiency.

This also reverts commit 599958d1148c1137bee925f4cf08eda7f8050d98
which granted adbd blanket parent immunity from monitoring on
userdebug builds.  The new logic is a more refined means of
preserving the live lock checking associated with adbd and allows
the operation to be performed on user builds.

POC: date ; adb shell setsid sleep 900 ; date
Positive for bug, reports less than 15 minutes, otherwise solved.

Test: llkd_unit_test
Bug: 120983740
Change-Id: I6442463a48499d925a3a074423a24a1622905559
</pre>
</div>
</content>
</entry>
<entry>
<title>llkd: enhance list properties</title>
<updated>2019-01-04T19:43:15+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2019-01-03T16:39:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=8a5f0817634c4837cb092c00cc3cd0cc41b9cc9b'/>
<id>8a5f0817634c4837cb092c00cc3cd0cc41b9cc9b</id>
<content type='text'>
Because of the limited length of properties, and to ease the
complexity of product and vendor adjustments, the comma separated
list properties will use a leading comma to preserve the defaults
and add or subtract entries with + and - prefixes respectively.

Without the leading comma, the list is explicitly specified as before.

Cleanup:
- use empty() instead of space() == 0 (or converse if != 0)
- if (unlikely) pprocp can not be allocated, to a to_string(ppid) check

For testing, observe before and after llkd_unit_test below to
confirm leading comma effects for example:

livelock: ro.llk.stack=wait_on_page_bit_killable,bit_wait_io,\
                       __get_user_pages,cma_alloc
livelock: ro.llk.stack=...,SyS_openat,...

Test: llkd_unit_test
Bug: 120983740
Change-Id: Ia3d164c2fdac5295a474c6c1294a34e4ae9d0b61
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because of the limited length of properties, and to ease the
complexity of product and vendor adjustments, the comma separated
list properties will use a leading comma to preserve the defaults
and add or subtract entries with + and - prefixes respectively.

Without the leading comma, the list is explicitly specified as before.

Cleanup:
- use empty() instead of space() == 0 (or converse if != 0)
- if (unlikely) pprocp can not be allocated, to a to_string(ppid) check

For testing, observe before and after llkd_unit_test below to
confirm leading comma effects for example:

livelock: ro.llk.stack=wait_on_page_bit_killable,bit_wait_io,\
                       __get_user_pages,cma_alloc
livelock: ro.llk.stack=...,SyS_openat,...

Test: llkd_unit_test
Bug: 120983740
Change-Id: Ia3d164c2fdac5295a474c6c1294a34e4ae9d0b61
</pre>
</div>
</content>
</entry>
<entry>
<title>llkd: check stack for wait_on_page_bit_killable</title>
<updated>2019-01-04T18:46:05+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2018-12-12T17:19:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=b658ffa2f397bfe6730a4791470476b54b9d645c'/>
<id>b658ffa2f397bfe6730a4791470476b54b9d645c</id>
<content type='text'>
User process in S state blocked by deadlock in I/O system

wait_on_page_bit is covered by regular D state tracking.

Bug: 120776455
Test: long term stability on multiple devices
Change-Id: Icdb99b8095f384cb440f0f2bdeba86c5991b9ef4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
User process in S state blocked by deadlock in I/O system

wait_on_page_bit is covered by regular D state tracking.

Bug: 120776455
Test: long term stability on multiple devices
Change-Id: Icdb99b8095f384cb440f0f2bdeba86c5991b9ef4
</pre>
</div>
</content>
</entry>
<entry>
<title>llkd: report stack signature matched</title>
<updated>2019-01-04T18:46:05+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2019-01-02T23:04:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=22e05fb5a4767ee7226564c9fb6b4a53f31bbe58'/>
<id>22e05fb5a4767ee7226564c9fb6b4a53f31bbe58</id>
<content type='text'>
Adjusted debugging messaging to add clarity.  Report _which_ stack
signature matched that triggered the kernel panic.  Reduce the noise
associated with missing /stack to VERBOSE as that is for development
debugging only.

Test: observe during unit test we see something like following logs:

livelock: Found SyS_openat in stack for pid XXX
livelock: S 120.000s XXX-&gt;YYY port-bridge [kill]
livelock: Killing '/vendor/bin/port-bridge' (XXX) to check forward\
          scheduling progress in S state for\
          '/vendor/bin/port-bridge' (YYY)
. . .
livelock: Found SyS_openat in stack for pid XXXXX
livelock: S 120.000s XXXXX-&gt;XXXXX llkd_unit_test [kill]
livelock: Killing '/data/nativetest64/llkd_unit_test/llkd_unit_test\
          (XXXXX) to check forward scheduling progress in S state

Test: llkd_unit_test
Bug: 33808187
Change-Id: Ifac7dd9a656208563bb20e28739abb741358d964
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adjusted debugging messaging to add clarity.  Report _which_ stack
signature matched that triggered the kernel panic.  Reduce the noise
associated with missing /stack to VERBOSE as that is for development
debugging only.

Test: observe during unit test we see something like following logs:

livelock: Found SyS_openat in stack for pid XXX
livelock: S 120.000s XXX-&gt;YYY port-bridge [kill]
livelock: Killing '/vendor/bin/port-bridge' (XXX) to check forward\
          scheduling progress in S state for\
          '/vendor/bin/port-bridge' (YYY)
. . .
livelock: Found SyS_openat in stack for pid XXXXX
livelock: S 120.000s XXXXX-&gt;XXXXX llkd_unit_test [kill]
livelock: Killing '/data/nativetest64/llkd_unit_test/llkd_unit_test\
          (XXXXX) to check forward scheduling progress in S state

Test: llkd_unit_test
Bug: 33808187
Change-Id: Ifac7dd9a656208563bb20e28739abb741358d964
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "llkd: adbd is allowed to be a bad parent on userdebug"</title>
<updated>2018-12-17T21:51:29+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2018-12-17T21:51:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=eb9b11c096414cef95d7104d7a410c5e7ffa9822'/>
<id>eb9b11c096414cef95d7104d7a410c5e7ffa9822</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge "llkd: make 100% sure process that triggers panic still exists"</title>
<updated>2018-12-14T20:35:08+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2018-12-14T20:35:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=00289c9c794314e8468895fcc7d70282c833d6c4'/>
<id>00289c9c794314e8468895fcc7d70282c833d6c4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>llkd: adbd is allowed to be a bad parent on userdebug</title>
<updated>2018-12-14T16:44:33+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2018-12-13T16:28:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=599958d1148c1137bee925f4cf08eda7f8050d98'/>
<id>599958d1148c1137bee925f4cf08eda7f8050d98</id>
<content type='text'>
If an errant process is identified, and the parent is adbd,
on userdebug builds bypass monitoring the process.

Test: unit tests
Bug: 120983740
Change-Id: I2af0797504326b0e95aa4377918b35d17716a6a2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an errant process is identified, and the parent is adbd,
on userdebug builds bypass monitoring the process.

Test: unit tests
Bug: 120983740
Change-Id: I2af0797504326b0e95aa4377918b35d17716a6a2
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix performance-for-range-copy warnings</title>
<updated>2018-12-11T18:51:13+00:00</updated>
<author>
<name>Chih-Hung Hsieh</name>
<email>chh@google.com</email>
</author>
<published>2018-12-11T18:34:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=1b7b7979aff6c7ff2c1ebe057237f21263ff5c28'/>
<id>1b7b7979aff6c7ff2c1ebe057237f21263ff5c28</id>
<content type='text'>
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I3ad102f2b0f971266d57488a3bd57d312f7ee3e6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug: 30413223
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,performance*
Change-Id: I3ad102f2b0f971266d57488a3bd57d312f7ee3e6
</pre>
</div>
</content>
</entry>
<entry>
<title>llkd: make 100% sure process that triggers panic still exists</title>
<updated>2018-12-10T21:34:02+00:00</updated>
<author>
<name>Mark Salyzyn</name>
<email>salyzyn@google.com</email>
</author>
<published>2018-12-04T18:30:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/replicant-next/system_core/commit/?id=fbc3a75ef49fa6577e7914b3dcf2b81cba78112a'/>
<id>fbc3a75ef49fa6577e7914b3dcf2b81cba78112a</id>
<content type='text'>
There is time between inspection, filtration, determination and
dumping before triggering panic, make 100% sure the process still
exists.  If we had one false start, but another process triggers
and panic in the same pass, then recognize that we have already
dumped the data and skip it on the later ones.

Test: llkd unit test.
Bug: 33808187
Bug: 120378563
Bug: 120229612
Change-Id: Iacaf82a3d58e5a3c18edcff3c8fa540b21da36f1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is time between inspection, filtration, determination and
dumping before triggering panic, make 100% sure the process still
exists.  If we had one false start, but another process triggers
and panic in the same pass, then recognize that we have already
dumped the data and skip it on the later ones.

Test: llkd unit test.
Bug: 33808187
Bug: 120378563
Bug: 120229612
Change-Id: Iacaf82a3d58e5a3c18edcff3c8fa540b21da36f1
</pre>
</div>
</content>
</entry>
</feed>
