Pass fflag down to g_ctl_req() and:
- Refuse all requests unless fflag has the FREAD bit set
- Refuse all but getxml unless fflag also has the FWRITE bit set
This should allow us to restore read access to /dev/geom.ctl for group
operator; they will then be able to run gpart list or gpart backup
but not commands that actually modify the table.
For backward compatibility, we set the FWRITE bit if it is not already
set and the calling thread has PRIV_IO privileges. This should cover
the case of older binaries (which open /dev/geom.ctl read-only) running
as root on a newer kernel. Since we intend to merge this to stable/15,
the compatibility code is conditional on COMPAT_FREEBSD14.
MFC after: 1 week
Event: EuroBSDCon 2026 DevSummit