killall can't kill processes with names >15 bytes long (Ubuntu 12.04)

Bug #970638 reported by jan5000 on 2012-04-01
62
This bug affects 9 people
Affects Status Importance Assigned to Milestone
psmisc (Debian)
Fix Released
Unknown
psmisc (Ubuntu)
Medium
Unassigned
Precise
Medium
Colin Watson

Bug Description

[Impact] killall doesn't work with long process names.
[Test Case] See the detailed test case below.
[Regression Potential] The changes files also affect fuser (slightly) and pstree, so it'd be worth making sure those still work properly.

Original report follows:

"prog_one_one_three" is an arbitrary program (couple of lines of 'C', sleep () loop). What the program does is, is a don't care.

ubuntu@test-0002:~$ ./prog_one_two_three&
[1] 1927
ubuntu@test-0002:~$ ps aux | grep prog_one_two_three
ubuntu 1927 0.0 0.0 4148 352 pts/0 S 08:20 0:00 ./prog_one_two_three
ubuntu 1933 0.0 0.0 9392 888 pts/0 S+ 08:21 0:00 grep --color=auto prog_one_two_three
ubuntu@test-0002:~$ killall prog_one_two_three
prog_one_two_three: no process found

****** Can't kill it *****

ubuntu@test-0002:~$ cp prog_one_two_three prog
ubuntu@test-0002:~$ ./prog&
[2] 1936
ubuntu@test-0002:~$ killall prog
[2]+ Terminated ./prog
ubuntu@test-0002:~$

******* KIll OK *********

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bash 4.2-1ubuntu3
ProcVersionSignature: Ubuntu 3.2.0-21.34-generic 3.2.13
Uname: Linux 3.2.0-21-generic x86_64
ApportVersion: 2.0-0ubuntu2
Architecture: amd64
Date: Sun Apr 1 08:33:13 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
SourcePackage: bash
UpgradeStatus: Upgraded to precise on 2012-03-31 (0 days ago)

jan5000 (jan5000) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

affects: bash (Ubuntu) → psmisc (Ubuntu)
Changed in psmisc (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
security vulnerability: yes → no
security vulnerability: yes → no
visibility: private → public
visibility: private → public

This regression was introduced by debian/patches/psmisc_strcpy_overflow in 22.15-2. Debian released a fixed this regression with 22.16-1.

With only a quick glance it looks like a combination of at least 2 upstream commits, and possibly more, collectively fix this bug. More investigation is needed.

Changed in psmisc (Debian):
status: Unknown → Fix Released
Jeremy Nickurak (nickurak) wrote :

I can confirm that compiling debian's fixed version under current ubuntu 12.04 successfully addresses the problem.

RobertH (robert-hunt) wrote :

I still have this bug

ps xa | grep myS
 6615 pts/1 S+ 0:00 /bin/bash ./myScript.sh
 6619 pts/0 S+ 0:00 grep --color=auto myS
bss@Frog:~$ killall -v myScript.sh
Killed myScript.sh(6615) with signal 15
bss@Froggy:~$ ps xa | grep myS
 6636 pts/1 S+ 0:00 /bin/bash ./myScriptWithALongName.sh
 6639 pts/0 S+ 0:00 grep --color=auto myS
bss@Frog:~$ killall -v myScriptWithALongName.sh
myScriptWithALongName.sh: no process found
bss@Frog:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

Micah Gersten (micahg) wrote :

Fixed in quantal with 22.16-1ubuntu1

Changed in psmisc (Ubuntu):
status: Confirmed → Fix Released
Changed in psmisc (Ubuntu Precise):
importance: Undecided → Medium
status: New → Triaged
tags: added: regression-release
Steve Langasek (vorlon) on 2012-05-31
Changed in psmisc (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Colin Watson (cjwatson) on 2012-07-04
Changed in psmisc (Ubuntu Precise):
assignee: nobody → Colin Watson (cjwatson)
James Hunt (jamesodhunt) on 2012-07-04
summary: - killall can't kill processes with fairly long names (Ubuntu 12.04)
+ killall can't kill processes with names >15 bytes (Ubuntu 12.04)
summary: - killall can't kill processes with names >15 bytes (Ubuntu 12.04)
+ killall can't kill processes with names >15 bytes long (Ubuntu 12.04)
Colin Watson (cjwatson) on 2012-07-12
description: updated
Changed in psmisc (Ubuntu Precise):
status: Triaged → In Progress

Hello jan5000, or anyone else affected,

Accepted psmisc into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/psmisc/22.15-2ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in psmisc (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
MMlosh (mmlosh) wrote :

I confirm that psmiscs installed from precise-proposed can successfully "killall plugin-container"
My installation is a bit messed up (and has no unity/gnome/kde), so I won't change the tag to "testing done".

But the same issue in pgrep (bug #954602) is still present

Clint Byrum (clint-fewbar) wrote :

I verified it using the given test case as well. Marking verification-done.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package psmisc - 22.15-2ubuntu1.1

---------------
psmisc (22.15-2ubuntu1.1) precise-proposed; urgency=low

  * Backport from 22.16:
    - Fix matching long commands in killall (LP: #970638).
 -- Colin Watson <email address hidden> Thu, 12 Jul 2012 17:57:23 +0100

Changed in psmisc (Ubuntu Precise):
status: Fix Committed → Fix Released
MMlosh (mmlosh) wrote :

The same issue in pgrep (bug #954602) is still there.
It would be great if that could be fixed together with this one

Several years on, this is still present in wily. I'm not sure if it's the same root cause, but pgrep plugin-container doesn't work. Annoying, as I typically do kill -9 `pgrep xxx`, and killing Nightly doesn't kill plugin-container (it will die some time later, causing apport to complain).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.