Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: SYS_pinsyscalls question
To:
Mateusz Guzik <mjguzik@gmail.com>
Cc:
Marc Espie <marc.espie.openbsd@gmail.com>, tech@openbsd.org
Date:
Sun, 23 Feb 2025 16:27:44 -0700

Download raw body.

Thread
Mateusz Guzik <mjguzik@gmail.com> wrote:

> Even if that's considered fine, there is a transition period where the
> table is just being installed. The code needs correct memory fences on
> both sides to make sure this works as expected.

It does not need one on both sides.

> Perhaps single-threading can be employed here?

in syscall_mi.h?   That's ridiculous.

Write a diff.  Test it.  Words are not code.

> > > The safest and easiest way out that I see is to only allow pinsyscalls
> > > if there is just one thread, assuming multithreaded usage was not
> > > meant to happen to begin with.
> >
> > No, that has to be wrong.  All a program needs to do for system call
> > locking not to occur, is to tfork first???
> 
> My assumption was any syscall pinning was expected to be done before
> the program starts threading.

All the text you are typing requires threading to started.