mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
OpenZFS 6314 - buffer overflow in dsl_dataset_name
Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com> Ported-by: Brian Behlendorf <behlendorf1@llnl.gov> OpenZFS-issue: https://www.illumos.org/issues/6314 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/d6160ee
This commit is contained in:
committed by
Brian Behlendorf
parent
43e52eddb1
commit
eca7b76001
+15
-15
@@ -1483,7 +1483,7 @@ get_callback(zfs_handle_t *zhp, void *data)
|
||||
char buf[ZFS_MAXPROPLEN];
|
||||
char rbuf[ZFS_MAXPROPLEN];
|
||||
zprop_source_t sourcetype;
|
||||
char source[ZFS_MAXNAMELEN];
|
||||
char source[ZFS_MAX_DATASET_NAME_LEN];
|
||||
zprop_get_cbdata_t *cbp = data;
|
||||
nvlist_t *user_props = zfs_get_user_props(zhp);
|
||||
zprop_list_t *pl = cbp->cb_proplist;
|
||||
@@ -1963,7 +1963,7 @@ typedef struct upgrade_cbdata {
|
||||
uint64_t cb_version;
|
||||
boolean_t cb_newer;
|
||||
boolean_t cb_foundone;
|
||||
char cb_lastfs[ZFS_MAXNAMELEN];
|
||||
char cb_lastfs[ZFS_MAX_DATASET_NAME_LEN];
|
||||
} upgrade_cbdata_t;
|
||||
|
||||
static int
|
||||
@@ -2412,7 +2412,7 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
||||
if (domain != NULL && domain[0] != '\0') {
|
||||
#ifdef HAVE_IDMAP
|
||||
/* SMB */
|
||||
char sid[ZFS_MAXNAMELEN + 32];
|
||||
char sid[MAXNAMELEN + 32];
|
||||
uid_t id;
|
||||
uint64_t classes;
|
||||
int err;
|
||||
@@ -2546,7 +2546,7 @@ print_us_node(boolean_t scripted, boolean_t parsable, int *fields, int types,
|
||||
size_t *width, us_node_t *node)
|
||||
{
|
||||
nvlist_t *nvl = node->usn_nvl;
|
||||
char valstr[ZFS_MAXNAMELEN];
|
||||
char valstr[MAXNAMELEN];
|
||||
boolean_t first = B_TRUE;
|
||||
int cfield = 0;
|
||||
int field;
|
||||
@@ -3417,7 +3417,7 @@ zfs_do_rollback(int argc, char **argv)
|
||||
boolean_t force = B_FALSE;
|
||||
rollback_cbdata_t cb = { 0 };
|
||||
zfs_handle_t *zhp, *snap;
|
||||
char parentname[ZFS_MAXNAMELEN];
|
||||
char parentname[ZFS_MAX_DATASET_NAME_LEN];
|
||||
char *delim;
|
||||
|
||||
/* check options */
|
||||
@@ -3818,7 +3818,7 @@ zfs_do_send(int argc, char **argv)
|
||||
*/
|
||||
if (strchr(argv[0], '@') == NULL ||
|
||||
(fromname && strchr(fromname, '#') != NULL)) {
|
||||
char frombuf[ZFS_MAXNAMELEN];
|
||||
char frombuf[ZFS_MAX_DATASET_NAME_LEN];
|
||||
enum lzc_send_flags lzc_flags = 0;
|
||||
|
||||
if (flags.replicate || flags.doall || flags.props ||
|
||||
@@ -3870,7 +3870,7 @@ zfs_do_send(int argc, char **argv)
|
||||
* case if they specify the origin.
|
||||
*/
|
||||
if (fromname && (cp = strchr(fromname, '@')) != NULL) {
|
||||
char origin[ZFS_MAXNAMELEN];
|
||||
char origin[ZFS_MAX_DATASET_NAME_LEN];
|
||||
zprop_source_t src;
|
||||
|
||||
(void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN,
|
||||
@@ -4004,7 +4004,7 @@ zfs_do_receive(int argc, char **argv)
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
char namebuf[ZFS_MAXNAMELEN];
|
||||
char namebuf[ZFS_MAX_DATASET_NAME_LEN];
|
||||
(void) snprintf(namebuf, sizeof (namebuf),
|
||||
"%s/%%recv", argv[0]);
|
||||
|
||||
@@ -4860,7 +4860,7 @@ store_allow_perm(zfs_deleg_who_type_t type, boolean_t local, boolean_t descend,
|
||||
{
|
||||
int i;
|
||||
char ld[2] = { '\0', '\0' };
|
||||
char who_buf[ZFS_MAXNAMELEN+32];
|
||||
char who_buf[MAXNAMELEN + 32];
|
||||
char base_type = ZFS_DELEG_WHO_UNKNOWN;
|
||||
char set_type = ZFS_DELEG_WHO_UNKNOWN;
|
||||
nvlist_t *base_nvl = NULL;
|
||||
@@ -5224,7 +5224,7 @@ static void
|
||||
print_fs_perms(fs_perm_set_t *fspset)
|
||||
{
|
||||
fs_perm_node_t *node = NULL;
|
||||
char buf[ZFS_MAXNAMELEN+32];
|
||||
char buf[MAXNAMELEN + 32];
|
||||
const char *dsname = buf;
|
||||
|
||||
for (node = uu_list_first(fspset->fsps_list); node != NULL;
|
||||
@@ -5233,7 +5233,7 @@ print_fs_perms(fs_perm_set_t *fspset)
|
||||
uu_avl_t *uge_avl = node->fspn_fsperm.fsp_uge_avl;
|
||||
int left = 0;
|
||||
|
||||
(void) snprintf(buf, ZFS_MAXNAMELEN+32,
|
||||
(void) snprintf(buf, sizeof (buf),
|
||||
gettext("---- Permissions on %s "),
|
||||
node->fspn_fsperm.fsp_name);
|
||||
(void) printf("%s", dsname);
|
||||
@@ -5430,7 +5430,7 @@ zfs_do_hold_rele_impl(int argc, char **argv, boolean_t holding)
|
||||
|
||||
for (i = 0; i < argc; ++i) {
|
||||
zfs_handle_t *zhp;
|
||||
char parent[ZFS_MAXNAMELEN];
|
||||
char parent[ZFS_MAX_DATASET_NAME_LEN];
|
||||
const char *delim;
|
||||
char *path = argv[i];
|
||||
|
||||
@@ -5558,7 +5558,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
|
||||
nvlist_t *nvl = NULL;
|
||||
nvpair_t *nvp = NULL;
|
||||
const char *zname = zfs_get_name(zhp);
|
||||
size_t znamelen = strnlen(zname, ZFS_MAXNAMELEN);
|
||||
size_t znamelen = strlen(zname);
|
||||
|
||||
if (cbp->cb_recursive) {
|
||||
const char *snapname;
|
||||
@@ -5579,7 +5579,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
|
||||
|
||||
while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
|
||||
const char *tag = nvpair_name(nvp);
|
||||
size_t taglen = strnlen(tag, MAXNAMELEN);
|
||||
size_t taglen = strlen(tag);
|
||||
if (taglen > cbp->cb_max_taglen)
|
||||
cbp->cb_max_taglen = taglen;
|
||||
}
|
||||
@@ -6695,7 +6695,7 @@ zfs_do_diff(int argc, char **argv)
|
||||
static int
|
||||
zfs_do_bookmark(int argc, char **argv)
|
||||
{
|
||||
char snapname[ZFS_MAXNAMELEN];
|
||||
char snapname[ZFS_MAX_DATASET_NAME_LEN];
|
||||
zfs_handle_t *zhp;
|
||||
nvlist_t *nvl;
|
||||
int ret = 0;
|
||||
|
||||
Reference in New Issue
Block a user