Page MenuHomeFreeBSD

fix vfs_domount() so that it check PRIV_VFS_MOUNT_EXPORTED
ClosedPublic

Authored by rmacklem on Dec 16 2022, 12:02 AM.
Tags
None
Referenced Files
F102577058: D37718.id.diff
Thu, Nov 14, 7:02 AM
F102566944: D37718.id114191.diff
Thu, Nov 14, 3:55 AM
Unknown Object (File)
Oct 15 2024, 7:52 AM
Unknown Object (File)
Sep 30 2024, 7:28 PM
Unknown Object (File)
Sep 30 2024, 4:39 AM
Unknown Object (File)
Sep 24 2024, 8:00 PM
Unknown Object (File)
Sep 24 2024, 3:16 PM
Unknown Object (File)
Sep 24 2024, 5:03 AM
Subscribers

Details

Summary

It appears that, prior to r158857 vfs_domount() checked
suser() when MNT_EXPORTED was specified.

r158857 appears to have broken this, since MNT_EXPORTED
was no longer set when mountd.c was converted to use nmount(2).
r164033 replaced the suser() check with
priv_check(td, PRIV_VFS_MOUNT_EXPORTED), which does the
same thing (ie. checks for effective uid == 0 assuming suses_enabled
is set).

This patch restores this check by setting MNT_EXPORTED when the
"export" mount option is specified to nmount().

I think this is reasonable since only mountd(8) should be setting
exports and I doubt any non-root mounted file system would
be setting its own exports.

Test Plan

Tested with an NFS server, where the exports were done
correctly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped