
oss-sec mailing list archives
Re: process exit statuses (was: CVE-2023-51767)
From: Simon McVittie <smcv () debian org>
Date: Tue, 23 Sep 2025 11:42:28 +0100
On Tue, 23 Sep 2025 at 05:21:13 +0200, Solar Designer wrote:
some other system component (perhaps a library or the kernel) may also trigger a process exit with some code (and there are only 256 to choose from)
There are slightly more than that at the wait() level, because "killed by signal N" is distinguishable from any normal exit status - although if the exiting executable is wrapped by an "adverb" like env(1), that will usually end up conflating "killed by signal N" with "exiting with status 128+N" and we're back to only having 256 choices.
I would say that best-practice for a component wanting to terminate a process abnormally should usually be to send it a fatal signal, rather than forcing it to _exit(). For example, assertion failures are better handled via abort() (SIGABRT) than as an exit status, and when the kernel terminates a process abnormally as a result of seccomp filters, resource limits or namespace-related constraints, it normally does so by killing the process with SIGSYS or SIGKILL.
For historical reasons libX11 and libdbus implement their optional exit-on-disconnection behaviour by exiting with status 1, but the equivalent code in GLib's D-Bus implementation uses raise(SIGTERM), which I think is a better implementation for exiting abnormally as a result of an external not-exactly-an-error condition.
smcv
Current thread:
- CVE-2023-51767: a bogus CVE in OpenSSH Damien Miller (Sep 22)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Stuart D Gathman (Sep 22)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Pedro Sampaio (Sep 22)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Solar Designer (Sep 22)
- Re: process exit statuses (was: CVE-2023-51767) Simon McVittie (Sep 23)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Peter Gutmann (Sep 23)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Todd C. Miller (Sep 23)
- Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Adiletta, Andrew (Sep 23)
- Re: Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Jacob Bachmeyer (Sep 23)
- Re: Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Peter Gutmann (Sep 24)
- Re: Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Jacob Bachmeyer (Sep 24)
- Re: Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Demi Marie Obenour (Sep 25)
- Re: Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Jacob Bachmeyer (Sep 25)
- Re: Re: [EXT] Re: [oss-security] CVE-2023-51767: a bogus CVE in OpenSSH Demi Marie Obenour (Sep 26)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Stuart D Gathman (Sep 22)
- Re: CVE-2023-51767: a bogus CVE in OpenSSH Damien Miller (Sep 24)