From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 31 11:16:28 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D941716A4CE for ; Thu, 31 Mar 2005 11:16:28 +0000 (GMT) Received: from dexter.zoopee.org (zoopee.org [192.117.108.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1EEC43D68 for ; Thu, 31 Mar 2005 11:16:27 +0000 (GMT) (envelope-from alsbergt@zoopee.org) Received: from alsbergt by dexter.zoopee.org with local (Exim 4.43) id 1DGxez-0003Xj-8j for freebsd-hackers@freebsd.org; Thu, 31 Mar 2005 13:16:25 +0200 Date: Thu, 31 Mar 2005 13:16:25 +0200 From: Tom Alsberg To: FreeBSD Hackers List Message-ID: <20050331111625.GA13338@zoopee.org> Mail-Followup-To: Tom Alsberg , FreeBSD Hackers List Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline X-Face: "5"j@Y1Peoz1; ftTv>\|['ox-csmV+:_RDNdi/2lSe2x?0:HVAeVW~ajwQ7RfDlcb^18eJ; t,O,s5-aNdU/DJ2E8h1s,..4}N9$27u`pWmH|; s!zlqqVwr9R^_ji=1\3}Z6gQBYyQ]{gd5-V8s^fYf{$V2*_&S>eA|SH@Y\hOVUjd[5eah{EO@gCr.ydSpJHJIU[QsH~bC?$C@O:SzF=CaUxp80-iknM(]q(W List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2005 11:16:29 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Perhaps this should go to -STABLE, I just couldn't be sure. We are trying out FreeBSD 5.4-PRERELEASE on diskless clients. I noticed one problem, being that when setting the LD_LIBRARY_PATH (or for that matter, LD_PRELOAD, and LD_LIBMAP_DISABLE) environment variables, nothing will run, as /libexec/ld-elf.so.1 complains: Cannot execute objects on / According to the sources, this was added in 5.4, and will happen if / is mounted noexec. In this case, / is mounted by the BTX PXE loader over NFS (from a FreeBSD 5.3 server, right now). "mount" does not show the noexec flag. However, with the attached little C program I verified that statfs really returns this flag (0x00000006). Now, I see that on FreeBSD 5.3 diskless clients this flag is also returned on / - just it happened that nobody looked at it until the change in rtld.c of FreeBSD 5.4: if (fs.f_flags & MNT_NOEXEC) { _rtld_error("Cannot execute objects on %s\n", fs.f_mntonname); close(fd); return NULL; } I didn't yet understand (didn't check much) - why does statfs report the MNT_NOEXEC flag on the / filesystem (and only the / filesystem, when it's mounted from NFS by the bootloader - not any other NFS filesystems)? BTW, this happens also with NetApp as the NFS server - just to rule out any possibility of relation here. Ideas appreciated, -- Tom -- Tom Alsberg - certified insane, complete illiterate. Homepage: http://www.cs.huji.ac.il/~alsbergt/ * An idea is not responsible for the people who believe in it. --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fstatfs.c" #include #include #include #include int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "invalid number of arguments"); return -1; } struct statfs stbuf; if (statfs(argv[1], &stbuf) != 0) { perror("fstatfs"); return -1; } printf("FLAGS: 0x%08X\n", stbuf.f_flags); if (stbuf.f_flags & MNT_NOEXEC) printf("MNT_NOEXEC\n"); return 0; } --OXfL5xGRrasGEqWY--