1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-02 17:08:56 +00:00

Fix kernel panic when inheriting properties without default.

There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2016-08-31 11:55:31 +00:00
parent 0c127808dd
commit 9007a8679a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305123

View File

@ -54,6 +54,8 @@ dodefault(zfs_prop_t prop, int intsz, int numints, void *buf)
return (SET_ERROR(ENOENT));
if (zfs_prop_get_type(prop) == PROP_TYPE_STRING) {
if (zfs_prop_default_string(prop) == NULL)
return (SET_ERROR(ENOENT));
if (intsz != 1)
return (SET_ERROR(EOVERFLOW));
(void) strncpy(buf, zfs_prop_default_string(prop),