Bug 221987 - ZFS does not validate the sharenfs parameter
Summary: ZFS does not validate the sharenfs parameter
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-01 22:43 UTC by Alan Somers
Modified: 2017-09-02 01:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer 2017-09-01 22:43:02 UTC
On Illumos, ZFS will validate that the "sharenfs" parameter is valid.  It will refuse to set it to an invalid value.  But FreeBSD does not validate it.  This could cause mountd to crash or misbehave.

Note that this is _not_ a security vulnerability, even in combination with ZFS delegations, because /etc/zfs/exports may only be updated by root, even when the sharenfs property is delegated.

$ sudo zpool create foo da0
$ sudo zfs set sharenfs=$'XXX\n/usr/home' foo
$ sudo cat /etc/zfs/exports 
# !!! DO NOT EDIT THIS FILE MANUALLY !!!

/foo    XXX
/usr/home