Go to file
Mark Salyzyn da2aeb0c42 llkd: handle 'adbd shell setsid' to preserve adbd
A zombie setsid process occurs when adb shell setsid <command> 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 <parent>&<child> in ro.llk.blacklist.parent as this
association, thus adbd&[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 599958d114
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
2019-01-04 13:49:48 -08:00
adb adbd: strip nulls from all service strings. 2018-12-27 11:19:44 -08:00
adf Make libadf, libsync_recovery recovery_available. 2018-08-07 10:53:07 -07:00
base Build libbase with _FILE_OFFSET_BITS=64. 2018-12-19 12:55:17 -08:00
bootstat switch to using android-base/file.h instead of android-base/test_utils.h 2018-11-14 09:35:34 -08:00
cpio Switch from dist-for-goals to dist in Android.bp 2018-11-19 23:06:12 -08:00
debuggerd Revert^2 "Use libdexfile external API in libunwindstack." 2018-12-19 21:04:35 +00:00
demangle Build adbd for recovery 2018-05-24 14:11:11 +09:00
diagnose_usb Build adbd for recovery 2018-05-24 14:11:11 +09:00
fastboot fastbootd: Better error message when boot_devices is missing. 2018-12-20 16:56:06 -08:00
fs_mgr Merge "fiemap_writer: First cut implementation with write() support." 2019-01-03 15:56:15 +00:00
gatekeeperd Multi-threaded Keystore 2018-11-07 11:39:23 -08:00
healthd healthd: BatteryMonitor: Fix compiler warning 2018-11-02 17:59:09 +00:00
include Move android_filesystem_config.h => fs_config.h 2017-08-02 16:31:19 -07:00
init init: document the early init boot phase 2018-12-27 12:51:32 -08:00
libappfuse use epoll_create1(EPOLL_CLOEXEC) 2018-12-17 09:32:23 -08:00
libasyncio Build adbd for recovery 2018-05-24 14:11:11 +09:00
libbacktrace Fix offsets when shared lib split across maps. 2018-12-18 11:22:14 -08:00
libbinderwrapper Make libbinderwrapper available in /vendor partition 2018-04-06 08:41:21 +09:00
libcrypto_utils Convert more modules to Android.bp 2018-10-31 21:53:37 -07:00
libcutils Merge "Add UID for network stack app" 2018-12-19 02:01:23 +00:00
libdiskconfig Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]] 2017-10-02 10:44:29 -07:00
libgrallocusage Merge "Build both static and shared lib." 2018-09-25 22:29:31 +00:00
libion libion: cleanup logging 2018-03-07 10:56:06 -08:00
libkeyutils Build adbd for recovery 2018-05-24 14:11:11 +09:00
liblog Merge "Add missing <android/log.h> documentation." 2018-11-02 23:32:43 +00:00
libmeminfo meminfo: Use getprogname(3) in all tools. 2018-12-30 13:42:20 -08:00
libmemtrack Add OWNERS. 2017-12-07 13:30:03 -08:00
libmemunreachable Validate allocations against mappings 2018-11-29 11:02:56 -08:00
libmetricslogger DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master 2018-12-11 14:46:12 -08:00
libnativebridge Convert more modules to Android.bp 2018-10-31 21:53:37 -07:00
libnativeloader Propagate dlopen errors to callers of OpenNativeLibrary. 2018-12-19 13:48:01 +00:00
libnetutils Merge "Add OWNERS." am: 3289b9c928 2017-12-07 23:51:13 +00:00
libpackagelistparser Mark as recovery_available: true 2018-05-15 09:47:04 +09:00
libpixelflinger Ignore null-pointer-arithmetic warning from dlmalloc include 2018-12-11 23:08:32 -08:00
libprocessgroup Introduce additional service options for controlling memory cgroups. 2018-10-31 17:09:59 -07:00
libprocinfo Add missing includes. 2018-12-06 10:09:20 -08:00
libqtaguid Redirect qtaguid native call to netd fwmark client 2017-11-09 18:02:22 -08:00
libsparse Fix cert-dcl16-c clang-tidy warnings. 2018-12-11 10:38:27 -08:00
libstats Log the last error code of StatsLog failures 2018-12-07 11:02:08 -08:00
libsuspend Remove libsuspend from VNDK. 2018-08-14 13:39:55 -07:00
libsync Merge libsync_recovery rules into libsync. 2018-08-07 11:00:50 -07:00
libsystem Move system/core/ off NO_ERROR. 2018-10-08 11:15:52 -07:00
libsysutils libsysutils can be linked statically 2018-12-06 12:32:49 +09:00
libunwindstack Merge "Move DwarfCfaInfo::kTable from data.rel.ro to rodata" 2018-12-21 12:58:26 +00:00
libusbhost Merge "Remove urb request size maximum." am: 1cb765c867 am: 1ab6e9d018 2018-02-13 09:02:38 +00:00
libutils CallStack: include prefix/tag when unlinked 2019-01-03 10:17:07 -08:00
libvndksupport bpfmt. 2018-02-16 17:58:14 -08:00
libziparchive zip_archive.cc: add O_CLOEXEC 2018-12-18 12:48:06 -08:00
llkd llkd: handle 'adbd shell setsid' to preserve adbd 2019-01-04 13:49:48 -08:00
lmkd lmkd: Cleanup unused code for killing processes in bulk 2018-10-29 16:20:50 +00:00
logcat Stop using __STRING unnecessarily. 2018-11-14 14:27:22 -08:00
logd Merge "logd: improve logd prune" 2018-12-21 16:20:14 +00:00
logwrapper Build adbd for recovery 2018-05-24 14:11:11 +09:00
mkbootimg Revert "Revert "mkbootimg: Build mkbootimg with Soong."" 2018-09-27 14:11:51 +00:00
property_service Prevent dependency cycle due to system_shared_libs expansion 2018-12-03 15:50:00 -08:00
qemu_pipe Build adbd for recovery 2018-05-24 14:11:11 +09:00
reboot reboot: only pause indefinitely for non-shutdown operations 2017-09-29 16:29:52 +00:00
rootdir Allow dlopen()ing libraries from the netd APEX on pasan build 2018-12-28 17:20:01 +08:00
run-as run-as: add ":fromRunAs" selector in seinfo. 2018-11-06 15:31:59 -08:00
sdcard Add support for esdfs mounting 2018-01-19 12:58:42 -08:00
shell_and_utilities Update shell documentation for the current state of master. 2018-12-05 13:08:32 -08:00
storaged storaged: emplace recent_perf in load_perf_history_proto 2018-11-20 09:00:05 -08:00
toolbox getevent: O_RDWR -> O_RDONLY | O_CLOEXEC 2018-08-24 12:16:17 -07:00
trusty Add noexcept to move constructors and assignment operators. 2018-10-05 16:43:47 +00:00
usbd bpfmt. 2018-02-16 17:58:14 -08:00
watchdogd Move watchdogd out of init 2018-08-02 12:25:58 -07:00
.clang-format Add a 2 width option of clang format. 2017-03-10 13:01:39 -08:00
.clang-format-2 Remove PenaltyExcessCharacter from clang-formats. 2018-07-19 13:50:41 -07:00
.clang-format-4 Remove PenaltyExcessCharacter from clang-formats. 2018-07-19 13:50:41 -07:00
.gitignore Ignore adb/*.pyc files 2015-08-11 12:59:58 -07:00
Android.bp Export android_filesystem_config.h as a filegroup 2017-01-17 18:20:28 -08:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:12:32 -07:00
CleanSpec.mk Shared libs are supported in recovery mode 2018-06-10 08:32:24 +09:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
NOTICE Fix omission in NOTICE file. 2013-07-30 13:56:55 -07:00
OWNERS Move per-file OWNERS directives to their directories. 2018-06-06 11:49:40 +09:00
PREUPLOAD.cfg Add a PREUPLOAD.cfg file to run git-clang-format on every commit 2017-03-08 16:51:26 +08:00
TEST_MAPPING TEST_MAPPING: add the rest of our actively maintained tests. 2018-10-30 11:24:57 -07:00