Bug#1134384: _exit uses NR_exit_group, leading to SIGKILL in seccomp

Simon Richter <[email protected]> Mon, 20 Apr 2026 14:22:05 +0900
Newsgroups gmane.linux.debian.devel.glibc
Message-ID <177666252560.1800814.11733521633695984233.reportbug__3191.80957028351$1776662608$gmane$org@simon>
Package: libc6
Followup-For: Bug #1134384
X-Debbugs-Cc: [email protected], [email protected]

reassign 1134384 manpages-dev
retitle 1134384 Document _exit(2) pitfall with seccomp(2)
tags 1134384 +patch
found 6.9.1-1
thanks

I guess the most sensible thing we can do here is document it.

   Simon

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

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

Versions of packages libc6 depends on:
ii  libgcc-s1  14.2.0-19

Versions of packages libc6 recommends:
ii  libidn2-0  2.3.8-2

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.91
ii  glibc-doc              2.41-12+deb13u2
ii  libc-l10n              2.41-12+deb13u2
pn  libnss-nis             <none>
pn  libnss-nisplus         <none>
ii  locales                2.41-12+deb13u2

-- debconf information excluded
0017-document-exit-pitfall-in-seccomp.patch (text/plain, 713 B)
Description: Document _exit(2) pitfall when using seccomp(2)
Author: Simon Richter <[email protected]>
Bug-Debian: https://bugs.debian.org/1134384
Forwarded: no
Last-Update: 2026-04-20

--- manpages-6.9.1.orig/man/man2/seccomp.2
+++ manpages-6.9.1/man/man2/seccomp.2
@@ -87,6 +87,16 @@ or by using
 to set the hard limit for
 .BR RLIMIT_CPU .
 .IP
+Also note that the glibc wrapper for
+.BR _exit (2)
+uses the
+.B SYS_exit_group
+system call to end the process, so process exit must also use the
+.BR syscall (2)
+interface, with
+.B SYS_exit
+as the system call number and the exit status as the second argument.
+.IP
 This operation is available only if the kernel is configured with
 .B CONFIG_SECCOMP
 enabled.