Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664480 - sys-process/psmisc-23.2 breaks killall by truncating command names
Summary: sys-process/psmisc-23.2 breaks killall by truncating command names
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-24 15:12 UTC by Hector Martin
Modified: 2020-06-21 06:01 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hector Martin 2018-08-24 15:12:15 UTC
Due to a regression, `killall` truncates command names to 7 characters on 64-bit arches and 3 (!) on 32-bit arches.

$ ln -s /bin/sleep /tmp/sleep12345678
$ /tmp/sleep12345678 1000&
[1] 24449
$ killall sleep12345678
sleep12345678: no process found
$ killall sleep12
[1]  + 24449 terminated  /tmp/sleep12345678 1000

Obvious bug is here:
https://gitlab.com/psmisc/psmisc/blob/1e2f38a202798a78554ae5f5d12f697f3607f89f/src/killall.c#L353

`comm` is a pointer, not an array. sizeof is getting the size of the pointer. So the maximum command length, which used to be 15, and was intended to be increased to 64, actually got reduced to 7 on 64-bit arches and 3 on 32-bit ones. Ouch.

sev major because, seriously, this is killall. It seems there's at least one other bug (#664066). I'd mask 23.2 until it's better tested and these issues fixed; psmisc is pretty basic functionality and even ~arch users probably don't expect killall to stop working.
Comment 1 Hector Martin 2018-08-24 15:23:17 UTC
Upstream issue: https://gitlab.com/psmisc/psmisc/issues/14
Comment 2 Jonas Stein gentoo-dev 2018-08-27 13:00:22 UTC

*** This bug has been marked as a duplicate of bug 664066 ***
Comment 3 Hector Martin 2018-08-27 13:23:36 UTC
Um, it's not a dupe. These are two different bugs in sys-process/psmisc-23.2.
Comment 4 Hector Martin 2020-06-21 06:01:10 UTC
This was fixed with the 23.2 upstream re-release together with 664066, in this commit:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c1e6dc1b44372a36852071f5f35b22e686d6cea