Linux could write to read only files on FreeBSD NFS server

Luoqi Chen luoqi.chen at gmail.com
Thu Feb 27 17:41:59 UTC 2020


Hi,

This was actually a pretty old problem, I noticed it a few years back and
have been monitoring it when I upgrade the os on either the linux or the
freebsd side -- it's still present between the latest centos and freebsd as
of today. I meant to look into this issue myself, but had never found time
for it, that's why I'm writing to this list, maybe it's a known problem or
someone's willing to spend some time on it.

And here you go, the problem,

% cat ~/rotest.sh
#!/bin/sh
cp /dev/null x
getfacl x
chmod -w x
getfacl x
echo aaa >> x
echo status $?
cat x
rm -f x
% sh ~/rotest.sh
# file: x
# owner: luoqi
# group: wheel
user::rw-
group::r--
other::r--

# file: x
# owner: luoqi
# group: wheel
user::r--
group::r--
other::r--

status 0
aaa

The script was run on a centos inside a directory nfs mounted from a
freebsd. The append would fail for a centos/centos or a freebsd/freebsd
combo. It's very easy to reproduce, it doesn't depend on any specific
centos or freebsd version, nor on nfs version 3 or 4, nor on underlying
file system ffs or zfs.

-luoqi


More information about the freebsd-fs mailing list