CVE-2017-1000198 (published 2017-11-17T02:29Z)

tcmu-runner daemon version 0.9.0 to 1.2.0 is vulnerable to invalid memory references in the handler_glfs.so handler resulting in denial of service

Severity: MEDIUM
CVSS v2 base score: 5.0 (AV:N/AC:L/Au:N/C:N/I:N/A:P)
CVSS v3 base score: 7.5, HIGH (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)

Weakness information:
cwe_id: CWE-119
cwe_name: Improper Restriction of Operations within the Bounds of a Memory Buffer
description: The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.
extended_description: 
            Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
         
         

Fix information:
repo_url: https://github.com/open-iscsi/tcmu-runner
commit_details: repo_url: https://github.com/open-iscsi/tcmu-runner
author: Prasanna Kumar Kalever
author_date: 2017-05-21 15:14:05+05:30
msg: glfs: discard glfs_check_config

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
repository: repo_url: https://github.com/open-iscsi/tcmu-runner
repo_name: open-iscsi/tcmu-runner
description: A daemon that handles the userspace side of the LIO TCM-User backstore.
repo_language: C
owner: open-iscsi
file_changes: filename: glfs.c
change_type: ModificationType.MODIFY
diff: @@ -430,58 +430,6 @@ static char* tcmu_get_path( struct tcmu_device *dev)
 	return config;
 }
 
-
-static bool glfs_check_config(const char *cfgstring, char **reason)
-{
-	char *path;
-	glfs_t *fs = NULL;
-	glfs_fd_t *gfd = NULL;
-	gluster_server *hosts = NULL; /* gluster server defination */
-	bool result = true;
-
-	path = strchr(cfgstring, '/');
-	if (!path) {
-		if (asprintf(reason, "No path found") == -1)
-			*reason = NULL;
-		result = false;
-		goto done;
-	}
-	path += 1; /* get past '/' */
-
-	fs = tcmu_create_glfs_object(path, &hosts);
-	if (!fs) {
-		tcmu_err("tcmu_create_glfs_object failed\n");
-		goto done;
-	}
-
-	gfd = glfs_open(fs, hosts->path, ALLOWED_BSOFLAGS);
-	if (!gfd) {
-		if (asprintf(reason, "glfs_open failed: %m") == -1)
-			*reason = NULL;
-		result = false;
-		goto unref;
-	}
-
-	if (glfs_access(fs, hosts->path, R_OK|W_OK) == -1) {
-		if (asprintf(reason, "glfs_access file not present, or not writable") == -1)
-			*reason = NULL;
-		result = false;
-		goto unref;
-	}
-
-	goto done;
-
-unref:
-	gluster_cache_refresh(fs, path);
-
-done:
-	if (gfd)
-		glfs_close(gfd);
-	gluster_free_server(&hosts);
-
-	return result;
-}
-
 static int tcmu_glfs_open(struct tcmu_device *dev)
 {
 	struct glfs_state *gfsp;
@@ -681,8 +629,6 @@ struct tcmur_handler glfs_handler = {
 	.subtype 	= "glfs",
 	.cfg_desc	= glfs_cfg_desc,
 
-	.check_config 	= glfs_check_config,
-
 	.open 		= tcmu_glfs_open,
 	.close 		= tcmu_glfs_close,
 	.read 		= tcmu_glfs_read,

programming_language: C