Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Mar 2018 09:42:47 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331420 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201803230942.w2N9gl5Q095017@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Mar 23 09:42:47 2018
New Revision: 331420
URL: https://svnweb.freebsd.org/changeset/base/331420

Log:
  zfs: fix mismatch between format specifier and type
  
  vdev_dbgmsg_print_tree printed vdev_id of uint64_t type with %u format
  specifier.  That caused subsequent parameters to be incorrectly read
  from the stack and lead to a crash when a wrong value was interpreted as
  a string pointer.
  
  This should be upstreamed.
  
  Reported by:	pho
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Fri Mar 23 09:40:41 2018	(r331419)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Fri Mar 23 09:42:47 2018	(r331420)
@@ -237,7 +237,7 @@ vdev_dbgmsg_print_tree(vdev_t *vd, int indent)
 	}
 
 	zfs_dbgmsg("%*svdev %u: %s%s, guid: %llu, path: %s, %s", indent,
-	    "", vd->vdev_id, vd->vdev_ops->vdev_op_type,
+	    "", (int)vd->vdev_id, vd->vdev_ops->vdev_op_type,
 	    vd->vdev_islog ? " (log)" : "",
 	    (u_longlong_t)vd->vdev_guid,
 	    vd->vdev_path ? vd->vdev_path : "N/A", state);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803230942.w2N9gl5Q095017>