diff options
author | Paul Dagnelie <[email protected]> | 2016-06-15 14:51:27 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-06-28 13:47:04 -0700 |
commit | d1d19c785497fafb5e239f67006f534651ed2f27 (patch) | |
tree | 45aa55a98c92908007cd46fedf68b4783a54f355 /tests/zfs-tests | |
parent | eca7b76001a7d33f78bd98884aef8325bdbf98e7 (diff) |
OpenZFS 6876 - Stack corruption after importing a pool with a too-long name
Reviewed by: Prakash Surya <[email protected]>
Reviewed by: Dan Kimmel <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Yuri Pankov <[email protected]>
Ported-by: Brian Behlendorf <[email protected]>
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.
OpenZFS-issue: https://www.illumos.org/issues/6876
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ca8674e
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh index 60ccc0dd6..441f7a7ae 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_rename_001_pos.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -92,6 +92,8 @@ function cleanup [[ -d $ALTER_ROOT ]] && \ log_must $RM -rf $ALTER_ROOT + [[ -e $VDEV_FILE ]] && \ + log_must $RM $VDEV_FILE } log_onexit cleanup @@ -159,4 +161,13 @@ while (( i < ${#pools[*]} )); do ((i = i + 1)) done +VDEV_FILE=$(mktemp /tmp/tmp.XXXXXX) + +log_must $MKFILE -n 128M $VDEV_FILE +log_must $ZPOOL create testpool $VDEV_FILE +log_must $ZFS create testpool/testfs +ID=$($ZPOOL get -Ho value guid testpool) +log_must $ZPOOL export testpool +log_mustnot $ZPOOL import $(echo $ID) $($PRINTF "%*s\n" 250 "" | $TR ' ' 'c') + log_pass "Successfully imported and renamed a ZPOOL" |