cap_sysctlbyname for hw.vmm.destroy

Mark Johnston markj at freebsd.org
Wed Apr 28 15:41:19 UTC 2021


On Wed, Apr 28, 2021 at 06:19:09PM +0300, Ionuț Mihalache wrote:
> Even with the fixes cap_sysctl still returns EPERM for that simple example.

Are you sure that libcap_sysctl is actually being used?  In other words,
are you compiling with -DWITH_CASPER?  If not, the program will call
cap_enter() and then try to read the sysctl directly, since
cap_sysctlbyname() will be a simple wrapper for sysctlbyname().

> 
> În mie., 28 apr. 2021 la 17:41, Mark Johnston <markj at freebsd.org> a scris:
> 
> > There are two bugs in the example, also present in your WIP.  I fixed
> > them here:
> >
> > https://cgit.freebsd.org/src/commit/?id=44bbda649dc6c1cdc5a99641e14c77157967e140
> >
> > On Wed, Apr 28, 2021 at 05:22:22PM +0300, Ionuț Mihalache wrote:
> > > I update the code now [1] but still the same error. Even without any
> > limits
> > > the cap_sysctlbyname fails after using cap_enter.


More information about the freebsd-hackers mailing list