summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/dld/dld_drv.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/src/uts/common/io/dld/dld_drv.c b/usr/src/uts/common/io/dld/dld_drv.c
index cfe0f78415..eca17349c3 100644
--- a/usr/src/uts/common/io/dld/dld_drv.c
+++ b/usr/src/uts/common/io/dld/dld_drv.c
@@ -717,8 +717,18 @@ drv_ioc_prop_common(dld_ioc_macprop_t *prop, intptr_t arg, boolean_t set,
else
err = drv_ioc_clrap(linkid);
} else {
- if (kprop->pr_valsize == 0)
- return (ENOBUFS);
+ /*
+ * You might think that the earlier call to
+ * mac_prop_check_size() should catch this but
+ * it can't. The autopush prop uses 0 as a
+ * sentinel value to clear the prop. This
+ * check ensures we don't allow a get with a
+ * valsize of 0.
+ */
+ if (kprop->pr_valsize == 0) {
+ err = ENOBUFS;
+ goto done;
+ }
kprop->pr_perm_flags = MAC_PROP_PERM_RW;
err = drv_ioc_getap(linkid, dlap);