From owner-freebsd-fs@FreeBSD.ORG Sat Dec 10 16:36:41 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 073301065678 for ; Sat, 10 Dec 2011 16:36:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D2BC88FC1F for ; Sat, 10 Dec 2011 16:36:39 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pBAGaRsK087216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 10 Dec 2011 18:36:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pBAGaQG6027539; Sat, 10 Dec 2011 18:36:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pBAGaPqb027538; Sat, 10 Dec 2011 18:36:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Dec 2011 18:36:25 +0200 From: Kostik Belousov To: Kamil Choudhury Message-ID: <20111210163625.GY50300@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kcC1fNEgTMCB/ozP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: mysterious sysctl failure on nullfs mount X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2011 16:36:41 -0000 --kcC1fNEgTMCB/ozP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 10, 2011 at 10:50:07AM -0500, Kamil Choudhury wrote: > Hi all: >=20 > I've been trying to figure out what's going on with this bug for a few da= ys now: >=20 > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=3D899628+0+current/freebsd-p= orts-bugs >=20 > Summary: you mount the virtualbox binaries to /usr/local/ via nullfs, and > execution fails with a syctl error. >=20 > I've figured out the bit of code that's causing the error, and I've > encapsulated it in the following (small) program: >=20 > #include > #include > #include > #include > #include >=20 > 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(); >=20 > 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" ); >=20 > return( 0 ); > } >=20 > 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. >=20 > 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. --kcC1fNEgTMCB/ozP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7jiokACgkQC3+MBN1Mb4hxsQCglmZH0/Urn1edNnWHpY0+P1qt 7qYAn2x0RJOavl+5kSayi++M6Kww7Brd =RCq9 -----END PGP SIGNATURE----- --kcC1fNEgTMCB/ozP--