From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id B8F9822D9F for ; Mon, 2 Sep 2024 14:51:39 +0200 (CEST) Received: (qmail 17550 invoked by uid 550); 2 Sep 2024 12:51:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 17515 invoked from network); 2 Sep 2024 12:51:35 -0000 Date: Mon, 2 Sep 2024 08:51:26 -0400 From: Rich Felker To: Florian Weimer Cc: "H.J. Lu" , Linux Kernel Mailing List , linux-api@vger.kernel.org, libc-alpha@sourceware.org, musl@lists.openwall.com Message-ID: <20240902125125.GS10433@brightrain.aerifal.cx> References: <20240829205436.GA14562@brightrain.aerifal.cx> <20240831092902.GA2724612@port70.net> <20240831150241.GP10433@brightrain.aerifal.cx> <20240831154101.GN32249@brightrain.aerifal.cx> <87v7zetg1j.fsf@oldenburg3.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v7zetg1j.fsf@oldenburg3.str.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] AT_MINSIGSTKSZ mismatched interpretation kernel vs libc On Mon, Sep 02, 2024 at 02:07:36PM +0200, Florian Weimer wrote: > * Rich Felker: > > > This is ambiguously worded (does "operating system" mean kernel?) and > > does not agree with POSIX, which defines it as: > > > > Minimum stack size for a signal handler. > > > > And otherwise just specifies that sigaltstack shall fail if given a > > smaller size. > > > > The POSIX definition is also underspecified but it's clear that it > > should be possible to execute at least a do-nothing signal handler > > (like one which immediately returns and whose sole purpose is to > > induce EINTR when intalled without SA_RESTART), or even a minimal one > > that does something like storing to a global variable, with such a > > small stack. Allowing a size where even a do-nothing signal handler > > results in a memory-clobbering overflow or access fault seems > > non-conforming to me. > > POSIX does not specify what happens on a stack overflow (or more > generally, if most resource limits are exceeded), so I think the > behavior is conforming on a technicality. It doesn't specify what happens on overflow. It does specify what happens on non-overflow: the program executes correctly. Failure to do that is the problem here, not failure to trap on fault. Rich