Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <634da58e-77d0-bea4-8ebf-f2c1fc933fee@redhat.com>
Date: Wed, 3 Feb 2021 22:28:16 -0500
From: Carlos O'Donell <carlos@...hat.com>
To: musl@...ts.openwall.com, Dominic Chen <d.c.ddcc@...il.com>,
 Rich Felker <dalias@...c.org>, fweimer@...hat.com
Subject: Re: 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.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.