Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZFS does not validate the sharenfs parameter #16971

Open
asomers opened this issue Jan 21, 2025 · 0 comments
Open

ZFS does not validate the sharenfs parameter #16971

asomers opened this issue Jan 21, 2025 · 0 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@asomers
Copy link
Contributor

asomers commented Jan 21, 2025

System information

Type Version/Name
Distribution Name FreeBSD
Distribution Version FreeBSD
Kernel Version 15.0-CURRENT
Architecture amd64
OpenZFS Version zfs-2.3.99-114-FreeBSD_ge0039c705 zfs-kmod-2.3.99-114-FreeBSD_ge0039c705

Describe the problem you're observing

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. I haven't checked Linux.

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

Describe how to reproduce the problem

Using bash:

$ 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

Downstream bug reports

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221987

@asomers asomers added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

1 participant