summaryrefslogtreecommitdiff
path: root/init/sigchld_handler.cpp
diff options
context:
space:
mode:
authorSuren Baghdasaryan <surenb@google.com>2019-07-19 10:55:39 -0700
committerSuren Baghdasaryan <surenb@google.com>2019-10-08 18:15:34 -0700
commit11dc734a06bd189de8cb6bccf4efd636fad68313 (patch)
tree9d56990c654d1439c06b4f81a9c9c67578966309 /init/sigchld_handler.cpp
parentf2081a96be37bde84f27f00585d664d3db675da2 (diff)
lmkd: Track processes using pidfds
lmkd uses PIDs to track processes, however occasionally a PID of a process might be reused without lmkd detecting that. This can happen if originally registered process crashes, PID numbers wrap around and the same PID gets reused for a different process. In this situation lmkd might kill a wrong process. To prevent this issue from occurring lmkd will track processes using their pidfd. During process registration lmkd calls sys_pidfd_open and stores returned pidfd with the process record. Returned pidfd will not be reused until lmkd closes it which happens only after the process is unregistered. This way lmkd ensures that process identification is unique and can't be reused. Bug: 135608568 Test: lmkd_unit_test with and without pidfd kernel support Change-Id: Ida10ea13905c250e47f792cdd6bd2e65aeaa3709 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Diffstat (limited to 'init/sigchld_handler.cpp')
0 files changed, 0 insertions, 0 deletions