killing su does not kill subprocess (SIGTERM not propagated)

Bug #1690820 reported by Radu Duta on 2017-05-15
This bug affects 3 people
Affects Status Importance Assigned to Milestone
shadow (Ubuntu)

Bug Description

Problem first appeared in login_4.1.5.1-1ubuntu9.4 and version login_4.1.5.1-1ubuntu9.2 was not affected.

Example where the subprocess 115576 has not been terminated:
root@ubuntu:~/sudebug/src/shadow- pkill sleep; ./su test -c 'sleep 9999'&
[1] 115575
root@ubuntu:~/sudebug/src/shadow- kill $!
root@ubuntu:~/sudebug/src/shadow- ...waiting for child to terminate.
pgrep sleep
[1]+ Exit 255 ./su test -c 'sleep 9999'
root@ubuntu:~/sudebug/src/shadow- pgrep sleep

Expected behavior:
root@ubuntu:~/sudebug/src/shadow- pkill sleep; ./su test -c 'sleep 9999' &
[1] 115503
root@ubuntu:~/sudebug/src/shadow- kill $!
Session terminated, terminating shell... ...terminated.

[1]+ Exit 143 ./su test -c 'sleep 9999'
root@ubuntu:~/sudebug/src/shadow- pgrep sleep

Radu Duta (rduta) on 2017-05-15
description: updated
information type: Public → Public Security
Serge Hallyn (serge-hallyn) wrote :

Thanks for filing, Radu.

The commit which fixed it is in this PR:


Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in shadow (Ubuntu):
status: New → Confirmed
Seth Arnold (seth-arnold) wrote :

Radu, thanks for the top-notch bug report.

Serge, Tobias, thanks for the rapid fix.

Changed in shadow (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public Security information  Edit
Everyone can see this security related information.

Other bug subscribers