Author: mav
Date: Thu Sep  1 13:14:31 2016
New Revision: 305194
URL: https://svnweb.freebsd.org/changeset/base/305194

Log:
  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 <[email protected]>
  Reviewed by: Dan Kimmel <[email protected]>
  Reviewed by: George Wilson <[email protected]>
  Reviewed by: Yuri Pankov <[email protected]>
  Approved by: Richard Lowe <[email protected]>
  Author: Paul Dagnelie <[email protected]>

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

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c       Thu Sep 
 1 13:04:36 2016        (r305193)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c       Thu Sep 
 1 13:14:31 2016        (r305194)
@@ -1786,7 +1786,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,
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to