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
F91512805: D37718.id114191.diff
Sun, Aug 18, 8:48 PM
Unknown Object (File)
Sat, Aug 10, 11:50 PM
Unknown Object (File)
Mon, Jul 29, 8:44 PM
Unknown Object (File)
Sun, Jul 28, 2:40 AM
Unknown Object (File)
Jun 24 2024, 5:08 AM
Unknown Object (File)
Dec 27 2023, 10:11 AM
Unknown Object (File)
Dec 23 2023, 12:24 AM
Unknown Object (File)
Dec 12 2023, 1:04 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 Not Applicable
Unit
Tests Not Applicable