From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21319 invoked from network); 3 Mar 2021 14:41:24 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 3 Mar 2021 14:41:24 -0000 Received: (qmail 27893 invoked by uid 550); 3 Mar 2021 14:41:21 -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 27869 invoked from network); 3 Mar 2021 14:41:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbuki-mvuki-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ythogjgG5mVBYRbW5gx2X94NnG6EdpLCqcDhTIewA9I=; b=0ggHVlAOUpE1sZ0oT6wpH+5bixDPC4diB+1QxT3AVngmhTV2YGDu8TN7sdo6BnNIVT tQAsIt5XEkphrKxf9LubOk4fN34UtWqnpUuM48mdgyMx8dN1DNhwytBnZb1pC70oQrw5 VpZUU8K7RH3fF3zhiENGUPaXZS2qcr1U7IUzu7mk+Rimj4u0wTQyoiHvtj7StAuVX5f5 1+9ab5+WqoMB0Hgybcf6QKN1B0BJH7PqSbA7APbAQTSBbXNm7gqD7JYRBDQkb7tr7iK/ WzamDQLa2Ew/Kn8M4cVtE7GLcJ0AUGlbXh+stCU7I1JE/IVudNgPBW9Aglz86cUTUAmy yTdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ythogjgG5mVBYRbW5gx2X94NnG6EdpLCqcDhTIewA9I=; b=MgnWRlwAm/THx7nXHHuD5baoIcn/LEJ1eD5skxIlQFwhJH+VJ7cQz5rqEVCaz0+TML n0C2fZjSp/3OVw9hcgK6Ck0mAQAuzMM8YsXwFFmBOc5Bz9HyJCt9LYAn38Xy4TzhV90i 4efpTeraLvG5tMeScxFz/0NNZUM3Na2pos0qQOfK1QSse8AVYZLmUN/d9W2aLiNgMbl0 ZK5RR/K3tEB7C6QDhOg+mSoB7ReDlCaTL8YqhpdkqJjYnuTT4HVY+RzmWud4Lfrw0LyR DrD90bucfUILyQpJpJYA/90ew+rYTw9MTvT4fGhpbmmFMYX/RAXItiG618Ae7HX4MnCG eU6A== X-Gm-Message-State: AOAM5320KtJXm2Uwm6xzznF+Eb26vBwy5CeG8GshCt7SEbq8PKEnbD5C qvnApuN38OfYIjvkPcXEIoigOtDQ315LZAzIOgMoMg== X-Google-Smtp-Source: ABdhPJxkWwQrsjRaq2TQkSNNduqyVAXODoRRroUJg/jXLs9J9tHkAoxR7LMyqX8GTehldfQFjYyUNK8OnVlSebKQipc= X-Received: by 2002:a17:902:a417:b029:e5:bcb3:b7b6 with SMTP id p23-20020a170902a417b02900e5bcb3b7b6mr3046794plq.48.1614782468425; Wed, 03 Mar 2021 06:41:08 -0800 (PST) MIME-Version: 1.0 References: <20200929183644.GE17637@brightrain.aerifal.cx> <20200929203407.GH17637@brightrain.aerifal.cx> <20200930001001.GI17637@brightrain.aerifal.cx> <20200930155547.GA4436@brightrain.aerifal.cx> In-Reply-To: <20200930155547.GA4436@brightrain.aerifal.cx> From: Jesse Hathaway Date: Wed, 3 Mar 2021 08:40:57 -0600 Message-ID: To: Rich Felker Cc: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Re: Pending patches for MT-fork stuff On Wed, Sep 30, 2020 at 10:55 AM Rich Felker wrote: > > > Here is the offending code: > > > > > > https://github.com/golang/go/blob/a413908dd064de6e3ea5b8d95d707a532bd3f4c8/src/runtime/signal_unix.go#L866 > > > > > > It should be calling sigfillset() (from libc) to get the starting > > > sigset_t rather than using its own all-one-bits initializer. > > > > > > There may be other places in the runtime where the same error is made. > > > It looks like blockableSig (line 1132) is intended to do something > > > here, but has hard-coded (somewhere else) glibc knowledge rather than > > > probing via (libc's) sigaddset whether the signal number is valid. > > > This might be a preferred point to fix it at. Unfortunately I failed to submit a bug report for this issue. However, the bug was reported by someone else and fixed with this commit: commit 49b017fe59bf628795f2c4fdbcb5db942e865fa9 Author: George Tsilias Date: Thu Jun 4 23:11:56 2020 +0300 runtime: handle signal 34 for musl setgid It has been observed that setgid hangs when using cgo with musl. This fix ensures that signal 34 gets handled in an appropriate way, like signal 33 when using glibc. Fixes #39343 Unfortunately, it did not use sigaddset as you suggested, but instead hard-coded the signal: diff --git a/src/runtime/sigtab_linux_generic.go b/src/runtime/sigtab_linux_generic.go index b26040b803..38d686544f 100644 --- a/src/runtime/sigtab_linux_generic.go +++ b/src/runtime/sigtab_linux_generic.go @@ -45,7 +45,7 @@ var sigtable = [...]sigTabT{ /* 31 */ {_SigThrow, "SIGSYS: bad system call"}, /* 32 */ {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */ /* 33 */ {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */ - /* 34 */ {_SigNotify, "signal 34"}, + /* 34 */ {_SigSetStack + _SigUnblock, "signal 34"}, /* musl SIGSYNCCALL; see issue 39343 */ /* 35 */ {_SigNotify, "signal 35"}, /* 36 */ {_SigNotify, "signal 36"}, /* 37 */ {_SigNotify, "signal 37"}, diff --git a/src/runtime/sigtab_linux_mipsx.go b/src/runtime/sigtab_linux_mipsx.go index 81dd2314c5..51ef470ce7 100644 --- a/src/runtime/sigtab_linux_mipsx.go +++ b/src/runtime/sigtab_linux_mipsx.go @@ -42,7 +42,7 @@ var sigtable = [...]sigTabT{ /* 31 */ {_SigNotify, "SIGXFSZ: file size limit exceeded"}, /* 32 */ {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */ /* 33 */ {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */ - /* 34 */ {_SigNotify, "signal 34"}, + /* 34 */ {_SigSetStack + _SigUnblock, "signal 34"}, /* musl SIGSYNCCALL; see issue 39343 */ /* 35 */ {_SigNotify, "signal 35"}, /* 36 */ {_SigNotify, "signal 36"}, /* 37 */ {_SigNotify, "signal 37"},