zfs allow log destroy parameter NULL #4890
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
issues: please see zfsonlinux#4872
Observed during Linux 2.6.32.41 automated testing while running the ZFS Test Suite. Cause ZFS software to produce coredump.
Cause analysis:
In zfs_ioc_log_history function, the implementation of tsd_set function, will he_value of the TSD module is set to null,
resulting in TSD module remove a entry, so he_value of the entry is null,
casue to implement zfs_allow_log_key private function zfs_allow_log_destroy.
zfs_allow_log_destroy parameter is null, the strfree a null. Produce coredump.
Solution:
1, in order to safety,
in the zfs_ioc_log_history function,from the TSD module to get to the poolName,
it is possible for the NULL, so whether the processing of NULL.
if poolname is NULL,return error.
2, zfs_allow_log_key of the private function zfs_allow_log_destroy in the Senate,
it is possible for the emergence of NULL,
so for arg release when the judge for the NULL and then strfree it.