Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Oct 2016 05:36:55 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r307116 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <201610120536.u9C5atPW021170@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Oct 12 05:36:55 2016
New Revision: 307116
URL: https://svnweb.freebsd.org/changeset/base/307116

Log:
  MFC r305194: MFV r302642:
  6876 Stack corruption after importing a pool with a too-long name
  
  illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41
  https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41
  
  https://www.illumos.org/issues/6876
    Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
    trouble. We should check every dataset on import, using a 1024 byte buffer and
    checking each time to see if the dataset's new name is longer than 256 bytes.
  
  Reviewed by: Prakash Surya <prakash.surya@delphix.com>
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Reviewed by: George Wilson <george.wilson@delphix.com>
  Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
  Approved by: Richard Lowe <richlowe@richlowe.net>
  Author: Paul Dagnelie <pcd@delphix.com>

Modified:
  stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Wed Oct 12 05:35:57 2016	(r307115)
+++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Wed Oct 12 05:36:55 2016	(r307116)
@@ -1799,7 +1799,12 @@ zpool_import_props(libzfs_handle_t *hdl,
 		case EEXIST:
 			(void) zpool_standard_error(hdl, error, desc);
 			break;
-
+		case ENAMETOOLONG:
+			zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+			    "new name of at least one dataset is longer than "
+			    "the maximum allowable length"));
+			(void) zfs_error(hdl, EZFS_NAMETOOLONG, desc);
+			break;
 		default:
 			(void) zpool_standard_error(hdl, error, desc);
 			zpool_explain_recover(hdl,



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