mysterious sysctl failure on nullfs mount
Kostik Belousov
kostikbel at gmail.com
Sat Dec 10 16:36:41 UTC 2011
On Sat, Dec 10, 2011 at 10:50:07AM -0500, Kamil Choudhury wrote:
> Hi all:
>
> I've been trying to figure out what's going on with this bug for a few days now:
>
> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=899628+0+current/freebsd-ports-bugs
>
> Summary: you mount the virtualbox binaries to /usr/local/ via nullfs, and
> execution fails with a syctl error.
>
> I've figured out the bit of code that's causing the error, and I've
> encapsulated it in the following (small) program:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <sys/param.h>
> #include <sys/sysctl.h>
>
> int main( void )
> {
> char g_szSupLibHardenedExePath[5000];
> int aiName[4];
> aiName[0] = CTL_KERN;
> aiName[1] = KERN_PROC;
> aiName[2] = KERN_PROC_PATHNAME;
> aiName[3] = getpid();
>
> size_t cbPath = sizeof( g_szSupLibHardenedExePath );
> printf( "%d\n", cbPath );
> if(sysctl(aiName, 4, g_szSupLibHardenedExePath, &cbPath, NULL, 0) < 0)
> printf( "sysctl failed" );
> else
> printf( "sysctl succeeded" );
>
> return( 0 );
> }
>
> Here's where it gets weird: if the code is executed in in
> /usr/local/lib/virtualbox, it fails with the sysctl error. If the code is
> executed in another location on the *same* nullfs mount (say,
> /usr/local/bin/), it executes fine.
>
> There seems to be a something at a filesystem level that's preventing
> execution -- does anyone on the list know what that something may be?
You did not specified which version of the OS you are running.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20111210/e8229193/attachment.pgp
More information about the freebsd-fs
mailing list