Your message dated Fri, 29 May 2020 11:24:33 +1000
with message-id 
<caly8cw7fqlz46awh2kc-oswb4uaundvnyo-1xozonenn5jk...@mail.gmail.com>
and subject line Re: Bug#961761: psmisc: killall fails to kill processes with 
names longer than 15 characters
has caused the Debian Bug report #961761,
regarding psmisc: killall fails to kill processes with names longer than 15 
characters
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
961761: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961761
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: psmisc
Version: 23.2-1
Severity: serious

killall fails to kill processes with names longer than 15
characters.

According to the manpage:

  -e, --exact
         Require an exact match for very long names.  If a command
         name is longer than 15 characters, the full name may be
         unavailable (i.e.  it is swapped  out). In  this case,
         killall will kill everything that matches within the first
         15 characters.  With -e, such entries are skipped.  [...]

So without "-e" it should kill everything that matches within the
first 15 characters.

That was apparently the behaviour in previous versions, but that's
broken now. To reproduce:

(echo "#!/bin/sh"; echo "while true; do sleep 1; echo 'Still running!'; done") 
> killall-bug-with-long-names-demo
chmod 755 killall-bug-with-long-names-demo
./killall-bug-with-long-names-demo &
killall killall-bug-with-long-names-demo

I think that's at least "serious", because it makes killall by name
basically unusable, at least in automated contexts, unless you want
to replace:

  killall "$x"

everywhere with some beast such as (untested):

  killall "$(echo "$x" | cut -c-15)"

It could even have more adverse consequences if you rely on a script
killing some process with killall, which has worked before and
breaks now, especially if this process continues to waste resources
or give access to privileges you meant to stop etc. (That's almost
what happened to me when I found the problem, though in my case the
worst thing it caused, fortunately, was blocking a network port.)

In the worst case, this could be security-critical. (Not sure if
this justifies "grave"!?)

Sure, you may say one should check the status of each command,
including killall, but that's hard to do when the status is the
same (1) as in the case when the program isn't running at all, so
one would have to check with something like pidof before (which does
still find long program names), worry about race-conditions etc.

-- System Information:
Debian Release: 10.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 
'proposed-updates-debug'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.14.0-0.bpo.3-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1), LANGUAGE=de_DE 
(charmap=ISO-8859-1)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages psmisc depends on:
ii  libc6        2.28-10
ii  libselinux1  2.8-1+b1
ii  libtinfo6    6.1+20181013-2+deb10u2

psmisc recommends no packages.

psmisc suggests no packages.

-- debconf-show failed

--- End Message ---
--- Begin Message ---
On Fri, 29 May 2020 at 09:21, Frank Heckenbach <f.heckenb...@fh-soft.de> wrote:
> killall fails to kill processes with names longer than 15
> characters.
Actually it does. But the comm length has increased for some kernels.

If you're asking it to kill something with another name because the
comm is "killall-bug-wit" not "killall-bug-with-long-names" it used to
work even though the command is wrong because it just cut the extra
characters off. This won't work when the comm length is increased.

$ ps -o comm 1739632
COMMAND
killall-bug-wit
$ killall killall-bug-wit

However 23.3 has a work-around where if the comm length is exactly 15
characters then it matches on this too.
This is a duplicate of bug #912748 and fixed in psmisc 23.3-1

 - Craig

--- End Message ---

Reply via email to