Author: avg
Date: Tue Jul 12 11:20:00 2016
New Revision: 302642
URL: https://svnweb.freebsd.org/changeset/base/302642

Log:
  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.su...@delphix.com>
  Reviewed by: Dan Kimmel <dan.kim...@delphix.com>
  Reviewed by: George Wilson <george.wil...@delphix.com>
  Reviewed by: Yuri Pankov <yuri.pan...@nexenta.com>
  Approved by: Richard Lowe <richl...@richlowe.net>
  Author: Paul Dagnelie <p...@delphix.com>

Modified:
  vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c

Changes in other areas also in this revision:
Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c

Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Tue Jul 12 11:18:25 
2016        (r302641)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_pool.c Tue Jul 12 11:20:00 
2016        (r302642)
@@ -1785,7 +1785,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,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to