Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: sysctl(2): unlock KERN_SPLASSERT
To:
Vitaliy Makkoveev <mvs@openbsd.org>
Cc:
Mark Kettenis <mark.kettenis@xs4all.nl>, OpenBSD tech <tech@openbsd.org>
Date:
Sun, 29 Dec 2024 21:50:52 -0700

Download raw body.

Thread
> sys/atomic.h has #ifndef SYS_ATOMIC_H guard against it.

But that's not the problem being described.

The problem is that everyone has to include the file. It becomes
a required file.  So it will be over-included.  You can talk about
the guard all you want, but it is still pulled in.

And when it isn't, it will get added in unreasonable places.
It is still multiple inclusion.

Adding it to the intr.h style files from the get-go is a clear
indication that there is no clear understanding that this is being
added as a new "intrinsic type".  Those are added in sys/_types.h.
But obviously it can't be there, right?  There's a reason for
pulling it in the wrong place. Eventually it will be pulled in from
many more wrong places.  Guard or not, is NOT FREE.

The second question is why does this variable need to suddenly be
protected as atomic.  Does it change halfway through a panic?  Or is
this dogma.  Is it dogma driven by some tools?