Skip to content
Commit c5e49e46 authored by Martin Flöser's avatar Martin Flöser
Browse files

Prevent kcheckpass from becoming an orphan

Summary:
With the long running kcheckpass there is the possibility that
kcheckpass becomes an orphan. Kcheckpass terminates once it gets
SIGUSR2 sent from the parent process (that is kscreenlocker_greet).

If kscreenlocker_greet crashes it cannot send SIGUSR2 to kcheckpass and
thus kcheckpass becomes an orphan. This can easily be seen in the
killTest autotest which results in many orphaned kcheckpass processes
after execution.

This change uses the linux specific PR_SET_PDEATHSIG to send SIGUSR2 to
kcheckpass when the parent process dies. Thus kcheckpass can get out of
the waiting and terminate without becoming an orphan.

In this case it is not a problem to use a linux specific syscall. The
long running kcheckpass is only used if kscreenlocker is built with
seccomp support which is also linux specific.

Test Plan:
Run killTest and check the number of orphaned kcheckpass.
Without this change we had 17 orphaned processes, with this change none.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5547
parent cc3265cf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment