diff options
author | Suren Baghdasaryan <surenb@google.com> | 2019-07-02 15:52:07 -0700 |
---|---|---|
committer | Suren Baghdasaryan <surenb@google.com> | 2019-07-12 15:12:16 +0000 |
commit | c68cf6fe656d4f6e82d7831ae0615f8d2a883eac (patch) | |
tree | ad21aaef4fd1c7f542b4e0c6f22f602f8c523bde /rootdir/init.rc | |
parent | b8aaa13a5f585565ba79990eb5041f4b8c6ada4e (diff) | |
download | system_core-c68cf6fe656d4f6e82d7831ae0615f8d2a883eac.tar.gz system_core-c68cf6fe656d4f6e82d7831ae0615f8d2a883eac.tar.bz2 system_core-c68cf6fe656d4f6e82d7831ae0615f8d2a883eac.zip |
lmkd: Prevent non-main threads being registered or killed by lmkd
Only thread group leaders should be registered with lmkd. Add a check to
ignore any non-leader TIDs and generate an error if such condition is
detected. Run the same check before killing a process to detect cases of
non-leader TIDs being used to kill a process. This might happen if PIDs
overflow and previously registered PID gets reused for a non-leader
thread in the following scenario:
1. pid X is a thread group leader and is registered with lmkd
2. pid X dies without lmkd knowing it and pid gets recycled
3. process Y creates a thread with tid X
4. lmkd kills pid X which results in process Y being killed
Bug: 136408020
Test: lmkd_unit_test
Change-Id: I46c5a0b273f2b72cefc20ec59b80b4393f2a1a37
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Diffstat (limited to 'rootdir/init.rc')
0 files changed, 0 insertions, 0 deletions