🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #2765

Bug#1152652: slay: User can resist being killed by "slay"

#2765
From: Martin Petricek
Date: Fri, 30 Oct 2026 23:20
53 lines
4037 bytes
Package: slay
Version: 3.0.2
Severity: important
X-Debbugs-Cc: martin.petricek@cint.com

Dear Maintainer,

Slay does not send signals as root, slay runs `kill` as the slayee:

    su -m $slayee -c "kill $SIGNAL -1"

That `kill` therefore runs with env su sets up for that user, including any AppArmor confinement attached to the user's sessions (i.e. via pam_apparmor).
If you set up pam_apparmor properly, then running:

    su -m user -c 'cat /proc/self/attr/current'

will print a profile in enforce mode rather than "unconfined", and the `kill -1` is then confined by that profile.
Running kill with pid -1 sends the signal only to processes the caller is allowed to signal and silently skips the rest.
Based on the used apparmor profile, ability to kill "own" processes thus may be severely limited,
especially if some of those processes have either changed hat, or changed to a different profile that cannot be signalled from the original profile.
If the user running inside the restricted apparmod profile can find a way to abuse capability to change hat or profile, this can be used to evade slay.

Another way the slayee can easily use to avoid being slain is abusing fork bomb - if the user exhausts limit on number of processes (ulimit -u), execve in su's child fail and slay will be unable to kill any of that user's processes.

I suspect there may be more ways to become "immune" to slay (set shell to some exotic one that does not understand or can override "kill" command?)
although I have not found any additional ways than those two described during my brief experimentation.

Suggested fix: kill the user's processes as root instead of as the slayee.
Unconfined root is not subject to the slayee's AppArmor confinement and is not affected by the slayee's limits.

-- System Information:
Debian Release: forky/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.107+deb13-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages slay depends on:
ii  debconf [debconf-2.0]  1.5.92

slay recommends no packages.

slay suggests no packages.

-- debconf information:
  slay/butthead: false
  slay/punish: false
Technical Details
Message-ID: <NU437-8TJq-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Martin Petricek <martin.petricek@cint.com>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1152652: slay: User can resist being killed by "slay"
Date: Sat, 31 Oct 2026 00:20:01 +0100
Message-ID: <NU437-8TJq-1@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Fri Oct 30 23:11:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.65
Reply-To: Martin Petricek <martin.petricek@cint.com>, 1152652@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: martin.petricek@cint.com, abe@debian.org
X-Debian-Pr-Message: report 1152652
X-Debian-Pr-Package: slay
X-Debian-Pr-Source: slay
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/1999846
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 53
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Sat, 31 Oct 2026 00:08:56 +0100
X-Original-Message-ID: <179340173649.1925599.8886056088526496265.reportbug@localhost>