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.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13278 invoked from network); 4 Feb 2021 03:28:39 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 4 Feb 2021 03:28:39 -0000 Received: (qmail 7869 invoked by uid 550); 4 Feb 2021 03:28:34 -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 7851 invoked from network); 4 Feb 2021 03:28:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612409302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aN8pG55ej1i2kjm8fnEeAO2XzF/XkU0+rIpF2Qn8lBk=; b=b8T+haQGaNIJNZlkFkdk3rZMBDLoVvhrv9lWLzMMXwiiSM2aWj9vNJqIhFHrgsBB0j2dPp 8xXC9E9F1vuPKKp866j2xprvYbyvMbtsmvYreAEuWAOakWejJc9qff+QnGRbPiUFbj6n1F 82kznVHz89/p9muZR+rtazAG2LdJZKI= X-MC-Unique: Ye_5SyFkPHSmXU15e6jFtg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=aN8pG55ej1i2kjm8fnEeAO2XzF/XkU0+rIpF2Qn8lBk=; b=bIsddRCFkHAzeAuz3sjbLA8FG+sjTpStiG2AZY0FssJJGZqXA87qDwscreTydbo08J B8RNrzXohAUfkxA2qUmUIEQgRTHaNKv3uupRcXsqmj7reQbyEWYG+lXvWFJwqSAkImN4 tV4qcpGyxsQU5qgAuVVOTtfXK/uAIWhMdzaOmhB5xtxzjbwEqTZZRP1VqRBOZioLHu8T /+D6ttT8U6Y19acnB960TCHOTPl7Fxr4D1nG9WEtAXp1JUZALgRGNOdA8OLemh7HPBCB jy3EHj5XgteXXhPlPTpTV0WoovoNYlkOLgtpwP9egJOfDZ8Zohm7VnLCInDZBWT7jz+l A5DA== X-Gm-Message-State: AOAM532sO8Xec0vq+aqCEpyFfNcAHkOCeBTOm4PMPLOnn0M74NSXBH9A C68TVDriKQoBzHkXIP1aXMV+/JFb77QKdT8vhHtXRlKRpC1CA6h3TqVM4bt884bmZtCK5zx7xuW YslvZMattItWXsDoRTg== X-Received: by 2002:aed:38a2:: with SMTP id k31mr5663132qte.187.1612409299089; Wed, 03 Feb 2021 19:28:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMKWtXB1JcQQXrH8q5M1p+7Qs7eZFEjFKjM5X3a8gF+9323oR4El+IS6+ghkGQc4zYTc8ZIg== X-Received: by 2002:aed:38a2:: with SMTP id k31mr5663124qte.187.1612409298936; Wed, 03 Feb 2021 19:28:18 -0800 (PST) To: musl@lists.openwall.com, Dominic Chen , Rich Felker , fweimer@redhat.com References: <62be4b85-4a42-413e-a83f-866eab4d601a@gmail.com> <20210203192145.GW23432@brightrain.aerifal.cx> From: Carlos O'Donell Organization: Red Hat Message-ID: <634da58e-77d0-bea4-8ebf-f2c1fc933fee@redhat.com> Date: Wed, 3 Feb 2021 22:28:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=carlos@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [musl] Incorrect thread TID caching On 2/3/21 3:21 PM, Dominic Chen wrote: > The code in question is a unittest for the sandbox, which manually > calls clone with CLONE_NEWPID to fork a child in a PID namespace, > then installs a signal handler and checks that it receives SIGTERM > correctly: > https://source.chromium.org/chromium/chromium/src/+/master:sandbox/linux/services/namespace_sandbox_unittest.cc;l=194 > . But under musl, raise() uses the cached TID value, so the test > eventually times out. > > I missed that the NamespaceSandbox::ForkInNewPidNamespace() function > does manually update the cached TID for glibc after calling the > ForkWithFlags wrapper, so I can just do the same for musl too. As Rich said for musl, this is not ABI for glibc either. I'm not sure why you need to reset the TID cache. In glibc we have containerized tests and we do not need to change internals of the runtime e.g. unshare (CLONE_NEWUSER, CLONE_NEWPID, CLONE_NEWNS); (see glibc/support/test-container.c). -- Cheers, Carlos.