Module Name:    src
Committed By:   riastradh
Date:           Sat Aug 28 10:47:46 UTC 2021

Modified Files:
        src/external/cddl/osnet/dist/lib/libzfs/common: libzfs_import.c

Log Message:
libzfs: Zero DIOCLWEDGES input before ioctl.

Otherwise we ask the kernel to write over whatever random pointer was
in the stack garbage here, when all we wanted was to learn whether
dkwl_nwedges is zero or nonzero.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
    src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c
diff -u src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.6 src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.7
--- src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c:1.6	Sat Apr  4 13:45:22 2020
+++ src/external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c	Sat Aug 28 10:47:45 2021
@@ -1099,6 +1099,7 @@ zpool_open_func(void *arg)
 	off_t size;
 
 	/* skip devices with wedges */
+	memset(&dkwl, 0, sizeof(dkwl));
 	if (native_ioctl(fd, DIOCLWEDGES, &dkwl) == 0 &&
 	    dkwl.dkwl_nwedges > 0) {
 		(void) close(fd);

Reply via email to