Anyone using binmiscctl for interesting things?
Kyle Evans <[email protected]> Thu, 18 Jun 2026 09:56:11 -0400
| Newsgroups | gmane.os.freebsd.devel.hackers |
|---|---|
| Message-ID | <[email protected]> |
Hi, I was chatting with Warner about this last night and he received it positively, so wider audience: I'd like to rewrite the binmiscctl interface into the kernel to allow scoping activator rules and that could have broader impact, so I'd like to hear about any uses that *aren't* qemu-user-static. Background: in today's world, imgact_binmisc.c exposes a sysctl that's only usable in prison0, and it registers interpreters for the whole system. I think that's suboptimal for $reasons that I'm happy to expand on, but the short version is that I'd like to replace the sysctl interface with a cdev/ioctl that can optionally be revealed in a child devfs, so that we can delegate control *and* implement per-jail activators. binmiscctl would likely grow a pair of flags, --inherit/--no-inherit, so that today's usage could still work just fine by using --inherit'ed rules in prison0. Eventually --no-inherit would become the default, but we'd probably want to first teach poudriere to stand-up binmiscctl rules in a jail as needed; ideally, we'd probably take the current set of activators from the qemu_user_static rc script[0] and install config file(s) that describe how TARGET/TARGET_ARCH pairs map to binmiscctl params that poudriere can ingest to make that maintainable. (CC'd bdrewery in case he already hates that idea just upon hearing it) The control interface will probably get split out to an imgact_binmisc_ctl.c at the start of this effort to try and clean some things up a little bit, since the sysctl interface should probably be retained in COMPAT_FREEBSD15- we could maybe debate later if the feature is niche enough that compatibility can drop once all supported releases have a binmiscctl(8) doing cdev things, but it's still worth making it maintainable up front. Thanks, Kyle Evans [0] https://cgit.freebsd.org/ports/tree/emulators/qemu-user-static/files/qemu_user_static.in