From eca7b76001a7d33f78bd98884aef8325bdbf98e7 Mon Sep 17 00:00:00 2001 From: Igor Kozhukhov Date: Wed, 15 Jun 2016 14:28:36 -0700 Subject: OpenZFS 6314 - buffer overflow in dsl_dataset_name Reviewed by: George Wilson Reviewed by: Prakash Surya Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Ported-by: Brian Behlendorf OpenZFS-issue: https://www.illumos.org/issues/6314 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/d6160ee --- include/sys/fs/zfs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/sys/fs/zfs.h') diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index e802454b9..b25d3016a 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -67,9 +67,13 @@ typedef enum dmu_objset_type { #define ZFS_TYPE_DATASET \ (ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME | ZFS_TYPE_SNAPSHOT) +/* + * All of these include the terminating NUL byte. + */ #define ZAP_MAXNAMELEN 256 #define ZAP_MAXVALUELEN (1024 * 8) #define ZAP_OLDMAXVALUELEN 1024 +#define ZFS_MAX_DATASET_NAME_LEN 256 /* * Dataset properties are identified by these constants and must be added to @@ -1019,7 +1023,7 @@ typedef enum zfs_ioc { /* * zvol ioctl to get dataset name */ -#define BLKZNAME _IOR(0x12, 125, char[ZFS_MAXNAMELEN]) +#define BLKZNAME _IOR(0x12, 125, char[ZFS_MAX_DATASET_NAME_LEN]) /* * Internal SPA load state. Used by FMA diagnosis engine. -- cgit v1.2.3