summaryrefslogtreecommitdiff
path: root/libutils/Unicode.cpp
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-07-02 15:52:07 -0700
committerSuren Baghdasaryan <surenb@google.com>2019-07-12 15:11:54 +0000
commit0082ef15cfeb36c86b633d448cf0b63430fa4c22 (patch)
tree968c4488cf887097f88178c741f0e5dd849d35ff /libutils/Unicode.cpp
parent4280165ae03280acd22765ef13042b2e166c6a19 (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