Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DLN2Y5RVE6E0.1VQOYUR82VWJT@trevorgross.com>
Date: Wed, 23 Sep 2026 18:21:15 -0500
From: "Trevor Gross" <tg@...vorgross.com>
To: <musl@...ts.openwall.com>, <tg@...vorgross.com>
Cc: <linux-man@...r.kernel.org>, <libc-alpha@...rceware.org>
Subject: Re: async-signal-safety of chroot

On Tue Sep 22, 2026 at 8:34 PM CDT, Rich Felker wrote:
> On Wed, Sep 23, 2026 at 12:53:16AM +0000, tg@...vorgross.com wrote:
>
> Since it's no longer standard, there is no standard governing chroot,
> but in practice on most systems, including Linux/musl, chroot is going
> to be AS-safe because it's just a single syscall.

Thanks Rich and others, that aligns with what I would have expected. In
that case this is a documentation request: I have a patch to the manual,
will send it in reply to this thread for any feedback.

> Also, both glibc and musl relax the restriction on only calling
> AS-safe functions in the child after a multi-threaded parent forks. In
> glibc this is sort of a best-effort thing, but in musl we went through
> a detailed process of ensuring that everything is made consistent for
> the child. The only thing that might not be consistent is dynamic
> linker state, which might make it impossible to dlopen in the child,
> but this is treated as a reportable error condition not a crash or
> deadlock or anything.
>
> The changes to lift the restrictions on the child happened in commit
> 167390f05564e0a4d3fcb4329377fd7743267560

That's great to learn about. I'll include a patch to document this as
well.

- Trevor

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.