Linux could write to read only files on FreeBSD NFS server

Rick Macklem rmacklem at uoguelph.ca
Wed Apr 8 01:20:07 UTC 2020


Luoqi Chen wrote:
>On Mon, Mar 2, 2020 at 2:48 PM Rick Macklem <rmacklem at uoguelph.ca<mailto:rmacklem at uoguelph.ca>> wrote:
>>Anyhow, if others test the patch and like it, I can commit it controlled via a sysctl.
>>I'd just have to decide whether it should be enabled by default or not.
>>
>>rick
>
>It has been more than a decade since I last developed for freebsd, I don't have
>anything running -current, but I did try the fix under 12-RELEASE, and can confirm
>it works. But my test is too ad hoc, it may need more thorough regression.
I have just committed a patch to head as r359720 that I believe handles this.
The difference between this patch and the one I posted some weeks ago is that
it only performs the "does file owner have permission" check for the case
where the NFSv4 Open is not creating the file.
This appears to be what the Linux server does and allows both the Linux and
FreeBSD clients to exhibit correct behaviour.

Since having it enabled does not seem to affect the FreeBSD client's behaviour,
I have it enabled by default, with a sysctl called vfs.nfsd.v4openaccess that can
be set to 0 to revert the NFSv4 server to the old behaviour.

This should be MFC'd to stable/12 and stable/11 in 2 weeks.

Thanks for reporting this, rick
ps: I finally was able to do interop. testing with Linux to see what was going on.

-luoqi


More information about the freebsd-fs mailing list