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=-2.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 69DDF2CFB6 for ; Thu, 29 Aug 2024 18:01:09 +0200 (CEST) Received: (qmail 24434 invoked by uid 550); 29 Aug 2024 16:01:04 -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 24399 invoked from network); 29 Aug 2024 16:01:03 -0000 Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ayaya.dev; s=key1; t=1724947255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xw1n+XJLAge+/SLbjLRiySIWts9X00fNBb9dN4W6SPo=; b=LvprIyd2vnMrTJ/csCDeK/O+EVwYXwXc90AfbHX6rGkM9Ob2CkwmWiLyowa8/qtz8qnV1u VxOY6uyp+yPWzqNP5tMQ8NuYjNZ9/Vj9G5qpIzbBaFOjpFKlNd7DvJ1VR8a8HSPNoLlL0h LaWui3COmJNA1o/493AyFhMsYX+E0Lo= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 29 Aug 2024 18:00:52 +0200 Message-Id: X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "alice" To: "Rich Felker" Cc: References: <20240829125727.GK10433@brightrain.aerifal.cx> In-Reply-To: <20240829125727.GK10433@brightrain.aerifal.cx> X-Migadu-Flow: FLOW_OUT Subject: Re: [musl] [PATCH] fix MINSIGSTKSZ and SIGSTKSZ for powerpc64 On Thu Aug 29, 2024 at 2:57 PM CEST, Rich Felker wrote: > On Thu, Aug 29, 2024 at 05:38:42AM +0200, psykose wrote: > > since kernel commit 2f82ec19757f58549467db568c56e7dfff8af283 > > (https://github.com/torvalds/linux/commit/2f82ec19757f58549467db568c56e= 7dfff8af283) > > the kernel has updated these minimum values. having these small values = breaks > > sysconf(_SC_MINSIGSTKSZ) too; it returns 4224 in musl currently which e= nds up > > returning ENOMEM from the syscall made in sigaltstack. > >=20 > > raising these to match the kernel fixes sigaltstack use on powerpc64(le= ). > > caught by glib's 2.82 testsuite > > I don't follow how you're claiming sysconf(_SC_MINSIGSTKSZ) is broken. > It will just return the kernel-provided value on new kernels that > insist on having a larger stack. In particular I don't see where the > value 4224 is supposed to be coming from. If there's something I'm > missing, please explain. sysconf(_SC_MINSIGSTKSZ) returns 4224 on ppc64le (this is as far as i know expected). setting stack.ss_size =3D 4224 (from that call) and passing it to sigaltsta= ck returns ENOMEM because it is smaller than 8192 which the kernel enforces. ..so the normal way of using sigaltstack with the smallest size (with sysco= nf or the macros) is broken. making the MINSIGSTKSZ match the actual value the kernel enforces fixes it.