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
panic in ioctl triggered whenever a nvlist without NV_UNIQUE_NAME is passed to lzc_sync
#11281
Labels
Type: Defect
Incorrect behavior (e.g. crash, hang)
Comments
codyps
added a commit
to codyps/rust-libzfs
that referenced
this issue
Dec 4, 2020
behlendorf
added a commit
to behlendorf/zfs
that referenced
this issue
Dec 4, 2020
When checking if the "force" argument is set it is sufficient to use nvlist_exists(). fnvlist_lookup_boolean_value() should not be used in this case since it's never allowed to fail which can happen when the provided nvlist does not set NV_UNIQUE_NAME. This is consistent with the boolean option handling for the other ioctls. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#11281
12 tasks
|
Thanks for reporting this. I've opened PR #11284 with a fix. |
behlendorf
added a commit
to behlendorf/zfs
that referenced
this issue
Dec 8, 2020
The fnvlist_lookup_boolean_value() function should not be used to check the force argument since it's optional. It may not be provided or may have been created with the wrong flags. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#11281
ghost
pushed a commit
to zfsonfreebsd/ZoF
that referenced
this issue
Dec 23, 2020
The fnvlist_lookup_boolean_value() function should not be used to check the force argument since it's optional. It may not be provided or may have been created with the wrong flags. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11281 Closes openzfs#11284
behlendorf
added a commit
that referenced
this issue
Dec 23, 2020
The fnvlist_lookup_boolean_value() function should not be used to check the force argument since it's optional. It may not be provided or may have been created with the wrong flags. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #11281 Closes #11284
jsai20
pushed a commit
to jsai20/zfs
that referenced
this issue
Mar 30, 2021
The fnvlist_lookup_boolean_value() function should not be used to check the force argument since it's optional. It may not be provided or may have been created with the wrong flags. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11281 Closes openzfs#11284
sempervictus
pushed a commit
to sempervictus/zfs
that referenced
this issue
May 31, 2021
The fnvlist_lookup_boolean_value() function should not be used to check the force argument since it's optional. It may not be provided or may have been created with the wrong flags. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#11281 Closes openzfs#11284
amybones
pushed a commit
to amybones/zfs
that referenced
this issue
Oct 24, 2023
Many of ioctls used in ZFS make use of the fnvlist_lookup_* family of functions, which assert when the associated nvlist_lookup_* function returns non-zero. On Linux, one consequence is that any program that issues an invalid ioctl will hang until manually killed since the kernel thread responsible has crashed. If such a program is run repeatedly, system resources could eventually be exhausted, making this a vector for a denial of service attack by unprivileged code. This issue was previously raised in openzfs#11281, and a fix applied was to the single ioctl that was reported as being problematic in that issue. To further improve the situation, this change introduces a simple check in zfs_check_input_nvpairs for the presence of either NV_UNIQUE_NAME or NV_UNIQUE_NAME_TYPE flags and returns EINVAL if not present, which prevents this issue from occuring for any of the non-legacy ioctls.
amybones
added a commit
to amybones/zfs
that referenced
this issue
Oct 24, 2023
Many of the ioctls in ZFS make use of the fnvlist_lookup_* family of functions, which assert when the associated nvlist_lookup_* function returns non-zero. On Linux, one consequence of this is that any program that issues an ioctl with a misconfigured nvlist will hang until manually killed since the kernel thread responsible has crashed. If such a program is run repeatedly, system resources could eventually be exhausted, making this a vector for a denial of service attack by unprivileged code. This issue was previously raised in openzfs#11281, and a fix applied was to the single ioctl that was reported as being problematic in that issue. To further improve the situation, this change introduces a simple check in zfs_check_input_nvpairs for the presence of either NV_UNIQUE_NAME or NV_UNIQUE_NAME_TYPE flags and returns EINVAL if not present, which prevents this issue from occuring for any of the non-legacy ioctls. Signed-off-by: amy bones <amy@spookygirl.boo>
amybones
added a commit
to amybones/zfs
that referenced
this issue
Oct 24, 2023
Many of the ioctls in ZFS make use of the fnvlist_lookup_* family of functions, which assert when the associated nvlist_lookup_* function returns non-zero. On Linux, one consequence of this is that any program that issues an ioctl with a misconfigured nvlist will hang until manually killed since the kernel thread responsible has crashed. If such a program is run repeatedly, system resources could eventually be exhausted, making this a vector for a denial of service attack by unprivileged code. This issue was previously raised in openzfs#11281, and a fix applied was to the single ioctl that was reported as being problematic in that issue. To further improve the situation, this change introduces a simple check in zfs_check_input_nvpairs for the presence of either NV_UNIQUE_NAME or NV_UNIQUE_NAME_TYPE flags and returns EINVAL if not present, which prevents this issue from occuring for any of the non-legacy ioctls. Signed-off-by: amy bones <amy@spookygirl.boo>
amybones
added a commit
to amybones/zfs
that referenced
this issue
Oct 26, 2023
Many of the ioctls in ZFS make use of the fnvlist_lookup_* family of functions, which assert when the associated nvlist_lookup_* function returns non-zero. On Linux, one consequence of this is that any program that issues an ioctl with a misconfigured nvlist will hang until manually killed since the kernel thread responsible has crashed. If such a program is run repeatedly, system resources could eventually be exhausted, making this a vector for a denial of service attack by unprivileged code. This issue was previously raised in openzfs#11281, and a fix applied was to the single ioctl that was reported as being problematic in that issue. To further improve the situation, this change introduces a simple check in zfs_check_input_nvpairs for the presence of either NV_UNIQUE_NAME or NV_UNIQUE_NAME_TYPE flags and returns EINVAL if not present, which prevents this issue from occuring for any of the non-legacy ioctls. Signed-off-by: amy bones <amy@spookygirl.boo>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System information
(This also occurs in older versions of openzfs. 0.8.5 was tested with the same issue)
Describe the problem you're observing
Calling
lzc_sync()with a nvlist created withoutNV_UNIQUE_NAMEresults in the process callinglzc_sync()being stuck in theDstate forever, and a panic is noted in dmesg:(full panic below)
Hang-check notes that the task is hung.
Describe how to reproduce the problem
Compile and Run this snippet on a system with a pool named "testpool".
Include any warning/errors/backtraces from the system logs
The text was updated successfully, but these errors were encountered: