Bug 221987

Summary: ZFS does not validate the sharenfs parameter
Product: Base System Reporter: Alan Somers <asomers>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: emaste
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

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 

/foo    XXX