kern/85268: NFS statfs corruption

Sten Spans sten at
Wed Aug 24 15:50:08 GMT 2005

>Number:         85268
>Category:       kern
>Synopsis:       NFS statfs corruption
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 24 15:50:07 GMT 2005
>Originator:     Sten Spans
>Release:        5.4-RELEASE-p1
FreeBSD 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #7: Fri May 20 10:19:10 CEST 2005     root at  i386

Specifying the mount_nfs -r option causes an nfsmount to get 
MNT_NOEXEC in statfs f_flags. This causes quite a few problems.
Please note that the mount is nog actually noexec, it just
has the bit set in f_flags.
I used the following test prog:

#include <stdlib.h>
#include <sys/param.h>
#include <sys/mount.h>

int main(int argc, char **argv) {

  struct statfs fs;

  if (statfs(argv[1], &fs) != 0)

  if (fs.f_flags & MNT_NOEXEC) {
  } else {

www1# gcc -o noexec noexec.c
www1# mount nfs3:/export/vol1/build/BUILDROOT-WWW /buildroot
www1# ./noexec /buildroot/
www1# umount /buildroot/
www1# mount -o -r=32768 nfs3:/export/vol1/build/BUILDROOT-WWW /buildroot
www1# ./noexec /buildroot/

this probably is a kernel problem.

More information about the freebsd-bugs mailing list