Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Dec 2011 10:50:07 -0500
From:      "Kamil Choudhury" <kamil.choudhury@anserinae.net>
To:        freebsd-fs@freebsd.org
Subject:   mysterious sysctl failure on nullfs mount
Message-ID:  <a115e80d65a1c010e1f056b80d02abd5.squirrel@webmail.anserinae.net>

next in thread | raw e-mail | index | archive | help
Hi all:

I've been trying to figure out what's going on with this bug for a few da=
ys now:

http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D899628+0+current/freebsd-p=
orts-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] =3D CTL_KERN;
        aiName[1] =3D KERN_PROC;
        aiName[2] =3D KERN_PROC_PATHNAME;
        aiName[3] =3D getpid();

        size_t cbPath =3D 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?

Thanks,
Kamil




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a115e80d65a1c010e1f056b80d02abd5.squirrel>