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:11:54 +0000 |
| commit | a33587350c78ca1b96e5425a97ff260613161277 (patch) | |
| tree | 968c4488cf887097f88178c741f0e5dd849d35ff /libutils/Unicode.cpp | |
| parent | ac46aaa52e57d58a727b8e863e184d15119147e0 (diff) | |
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 'libutils/Unicode.cpp')
0 files changed, 0 insertions, 0 deletions
