Try to open the control device read-write first, and fall back to
read-only if that fails and the error is EACCES.
MFC after: 1 week
Event: EuroBSDCon 2026 DevSummit
Differential D59592
libgeom: Open the control device read-write Authored by des on Fri, Sep 11, 2:51 PM. Tags None Referenced Files
Subscribers
Details
Diff Detail
Event TimelineComment Actions The only concern I have with the kernel enforcing write is what happens if we boot old binary, new kernel (which is quite typical). Would we have situations where we can't configure the system enough to build/install a new binary. Comment Actions We could add some logic in g_ctl_ioctl() that sets FWRITE if the caller is the superuser, and then remove it in a year or two? Or make it conditional on COMPAT_FREEBSD15? Comment Actions I like the idea of hiding it behind COMPAT_FREEBSD15 with the intention of ripping it out in a year or two We could also maybe haggle over a security.* sysctl to allow the new behavior now, so that one can get it early without having to compromise on compat to improve their security posture when they otherwise wouldn't. Comment Actions The commit log explains what the change is doing, but not why it's doing it. (I know the reason, but it should still be explained.) |