[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2017-11-04 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

2 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
22 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1382470:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 3227 in 
glusterd_op_stage_gsync_create()



*** CID 1382470:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 3227 in 
glusterd_op_stage_gsync_create()
3221 if (ret) {
3222 gf_msg (this->name, GF_LOG_ERROR, 0, 
GD_MSG_DICT_SET_FAILED,
3223 "Unable to store statefile path");
3224 goto out;
3225 }
3226 
>>> CID 1382470:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
>>> Calling strncpy with a maximum size argument of 4096 bytes on 
>>> destination array "statefiledir" of size 4096 bytes might leave the 
>>> destination string unterminated.
3227 strncpy (statefiledir, statefile, sizeof(statefiledir));
3228 statedir = dirname (statefiledir);
3229 
3230 ret = sys_lstat (statedir, );
3231 if (!ret && !is_force) {
3232 snprintf (errmsg, sizeof (errmsg), "Session between %s"

** CID 1382469:(DEADCODE)
/heal/src/glfs-heal.c: 1749 in main()
/heal/src/glfs-heal.c: 1750 in main()
/heal/src/glfs-heal.c: 1751 in main()
/heal/src/glfs-heal.c: 1752 in main()
/heal/src/glfs-heal.c: 1753 in main()
/heal/src/glfs-heal.c: 1754 in main()
/heal/src/glfs-heal.c: 1755 in main()
/heal/src/glfs-heal.c: 1756 in main()
/heal/src/glfs-heal.c: 1757 in main()
/heal/src/glfs-heal.c: 1758 in main()
/heal/src/glfs-heal.c: 1759 in main()



*** CID 1382469:(DEADCODE)
/heal/src/glfs-heal.c: 1749 in main()
1743, file, 
heal_op);
1744 break;
1745 case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:
1746 ret = glfsh_heal_from_brick (fs, top_subvol, ,
1747  hostname, path, file);
1748 break;
>>> CID 1382469:(DEADCODE)
>>> Execution cannot reach this statement: "case GF_SHD_OP_INVALID:".
1749 case GF_SHD_OP_INVALID:
1750 case GF_SHD_OP_HEAL_INDEX:
1751 case GF_SHD_OP_HEAL_FULL:
1752 case GF_SHD_OP_HEALED_FILES:
1753 case GF_SHD_OP_HEAL_FAILED_FILES:
1754 case GF_SHD_OP_STATISTICS:
/heal/src/glfs-heal.c: 1750 in main()
1744 break;
1745 case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:
1746 ret = glfsh_heal_from_brick (fs, top_subvol, ,
1747  hostname, path, file);
1748 break;
1749 case GF_SHD_OP_INVALID:
>>> CID 1382469:(DEADCODE)
>>> Execution cannot reach this statement: "case GF_SHD_OP_HEAL_INDEX:".
1750 case GF_SHD_OP_HEAL_INDEX:
1751 case GF_SHD_OP_HEAL_FULL:
1752 case GF_SHD_OP_HEALED_FILES:
1753 case GF_SHD_OP_HEAL_FAILED_FILES:
1754 case GF_SHD_OP_STATISTICS:
1755 case GF_SHD_OP_STATISTICS_HEAL_COUNT:
/heal/src/glfs-heal.c: 1751 in main()
1745 case GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK:
1746 ret = glfsh_heal_from_brick (fs, top_subvol, ,
1747  hostname, path, file);
1748 break;
1749 case GF_SHD_OP_INVALID:
1750 case GF_SHD_OP_HEAL_INDEX:
>>> CID 1382469:(DEADCODE)
>>> Execution cannot reach this statement: "case GF_SHD_OP_HEAL_FULL:".
1751 case GF_SHD_OP_HEAL_FULL:
1752 case GF_SHD_OP_HEALED_FILES:
1753 case GF_SHD_OP_HEAL_FAILED_FILES:
1754 case GF_SHD_OP_STATISTICS:
1755 case GF_SHD_OP_STATISTICS_HEAL_COUNT:
1756 case GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA:
/heal/src/glfs-heal.c: 1752 in main()
1746 ret = glfsh_heal_from_brick (fs, top_subvol, ,
1747  hostname, path, file);
1748 break;
1749 case GF_SHD_OP_INVALID:
1750 case GF_SHD_OP_HEAL_INDEX:
1751 case GF_SHD_OP_HEAL_FULL:
>>> CID 1382469:(DEADCODE)
>>> Execution cannot reach this statement: "case GF_SHD_OP_HEALED_FILES:".
1752 case GF_SHD_OP_HEALED_FILES:
1753   

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2017-11-03 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

146 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
180 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 146 defect(s)


** CID 1382343:  Incorrect expression  (NO_EFFECT)
/xlators/cluster/dht/src/dht-common.c: 4962 in dht_dir_common_setxattr()



*** CID 1382343:  Incorrect expression  (NO_EFFECT)
/xlators/cluster/dht/src/dht-common.c: 4962 in dht_dir_common_setxattr()
4956 
4957 conf = this->private;
4958 local= frame->local;
4959 call_cnt = conf->subvolume_cnt;
4960 local->flags = flags;
4961 
>>> CID 1382343:  Incorrect expression  (NO_EFFECT)
>>> Comparing an array to null is not useful: "local->gfid", since the test 
>>> will always evaluate as true.
4962 if (local->gfid)
4963 gf_uuid_unparse(local->gfid, gfid_local);
4964 
4965 /* Check if any user xattr present in xattr
4966 */
4967 dict_foreach_fnmatch (xattr, "user*", dht_is_user_xattr,

** CID 1382342:  Null pointer dereferences  (FORWARD_NULL)
/rpc/rpc-transport/socket/src/socket.c: 2981 in socket_server_event_handler()



*** CID 1382342:  Null pointer dereferences  (FORWARD_NULL)
/rpc/rpc-transport/socket/src/socket.c: 2981 in socket_server_event_handler()
2975  * the new_trans since we've failed at 
everything so far
2976  */
2977 rpc_transport_unref (new_trans);
2978 }
2979 }
2980 out:
>>> CID 1382342:  Null pointer dereferences  (FORWARD_NULL)
>>> Dereferencing null pointer "ctx".
2981 event_handled (ctx->event_pool, fd, idx, gen);
2982 
2983 if (cname && (cname != this->ssl_name)) {
2984 GF_FREE(cname);
2985 }
2986 return ret;

** CID 1382341:  Null pointer dereferences  (FORWARD_NULL)
/libglusterfs/src/ctx.c: 50 in glusterfs_ctx_new()



*** CID 1382341:  Null pointer dereferences  (FORWARD_NULL)
/libglusterfs/src/ctx.c: 50 in glusterfs_ctx_new()
44 #endif
45 
46 /* lock is never destroyed! */
47  ret = LOCK_INIT (>lock);
48  if (ret) {
49  free (ctx);
>>> CID 1382341:  Null pointer dereferences  (FORWARD_NULL)
>>> Assigning: "ctx" = "NULL".
50  ctx = NULL;
51  }
52 
53 GF_ATOMIC_INIT (ctx->stats.max_dict_pairs, 0);
54 GF_ATOMIC_INIT (ctx->stats.total_pairs_used, 0);
55 GF_ATOMIC_INIT (ctx->stats.total_dicts_used, 0);

** CID 1325526:(USE_AFTER_FREE)
/xlators/storage/posix/src/posix.c: 6061 in _posix_handle_xattr_keyvalue_pair()
/xlators/storage/posix/src/posix.c: 6061 in _posix_handle_xattr_keyvalue_pair()



*** CID 1325526:(USE_AFTER_FREE)
/xlators/storage/posix/src/posix.c: 6061 in _posix_handle_xattr_keyvalue_pair()
6055 
6056 out:
6057 if (op_ret < 0)
6058 filler->op_errno = op_errno;
6059 
6060 if (array)
>>> CID 1325526:(USE_AFTER_FREE)
>>> Calling "__gf_free" frees pointer "array" which has already been freed.
6061 GF_FREE (array);
6062 
6063 return op_ret;
6064 }
6065 
6066 /**
/xlators/storage/posix/src/posix.c: 6061 in _posix_handle_xattr_keyvalue_pair()
6055 
6056 out:
6057 if (op_ret < 0)
6058 filler->op_errno = op_errno;
6059 
6060 if (array)
>>> CID 1325526:(USE_AFTER_FREE)
>>> Passing freed pointer "array" as an argument to "__gf_free".
6061 GF_FREE (array);
6062 
6063 return op_ret;
6064 }
6065 
6066 /**

** CID 1292646:  Insecure data handling  (TAINTED_SCALAR)



*** CID 1292646:  Insecure data handling  (TAINTED_SCALAR)
/libglusterfs/src/store.c: 611 in gf_store_iter_get_next()
605 store_errno = GD_STORE_ENOMEM;
606 goto out;
607 }
608 ret = 0;
609 
610 out:
>>> CID 1292646:  Insecure data handling  (TAINTED_SCALAR)
>>> Passing tainted variable "scan_str" to a tainted sink.
611 GF_FREE 

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2017-02-05 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

70 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
52 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 70 defect(s)


** CID 1370957:  Code maintainability issues  (UNUSED_VALUE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:
 9610 in glusterd_volume_tier_use_rsp_dict()



*** CID 1370957:  Code maintainability issues  (UNUSED_VALUE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:
 9610 in glusterd_volume_tier_use_rsp_dict()
9604 ret = dict_get_str (rsp_dict, GF_REMOVE_BRICK_TID_KEY,
9605 _id_str);
9606 if (ret) {
9607 gf_msg_debug (this->name, errno,
9608 "Missing remove-brick-id");
9609 } else
>>> CID 1370957:  Code maintainability issues  (UNUSED_VALUE)
>>> Assigning value from "dict_set_str(ctx_dict, "remove-brick-id", 
>>> task_id_str)" to "ret" here, but that stored value is overwritten before it 
>>> can be used.
9610 ret = dict_set_str (ctx_dict, GF_REMOVE_BRICK_TID_KEY,
9611 task_id_str);
9612 
9613 ret = 0;
9614 
9615 out:

** CID 1370956:  Memory - illegal accesses  (UNINIT)
/xlators/experimental/jbr-server/src/jbr-cg.c: 1182 in jbr_open_term()



*** CID 1370956:  Memory - illegal accesses  (UNINIT)
/xlators/experimental/jbr-server/src/jbr-cg.c: 1182 in jbr_open_term()
1176 void
1177 jbr_open_term (call_frame_t *frame, xlator_t *this, dict_t *xdata)
1178 {
1179 int32_t op_errno;
1180 char*cl_dir;
1181 char*term;
>>> CID 1370956:  Memory - illegal accesses  (UNINIT)
>>> Declaring variable "path" without initializer.
1182 char*path;
1183 jbr_private_t   *priv   = this->private;
1184 
1185 op_errno = jbr_get_changelog_dir(this, _dir);
1186 if (op_errno) {
1187 goto err;

** CID 1370955:  Null pointer dereferences  (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tier.c:
 1374 in glusterd_op_tier_status()



*** CID 1370955:  Null pointer dereferences  (REVERSE_INULL)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tier.c:
 1374 in glusterd_op_tier_status()
1368 goto out;
1369 }
1370 
1371 GD_SYNCOP (rpc, (), NULL, 
glusterd_tier_status_cbk, req,
1372_brick_prog, req->op, 
xdr_gd1_mgmt_brick_op_req);
1373 
>>> CID 1370955:  Null pointer dereferences  (REVERSE_INULL)
>>> Null-checking "req" suggests that it may be null, but it has already 
>>> been dereferenced on all paths leading to the check.
1374 if (req) {
1375 GF_FREE (req);
1376 req = NULL;
1377 }
1378 if (!ret)
1379 pending_bricks++;

** CID 1370954:  Security best practices violations  (SECURE_TEMP)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c:
 157 in glusterd_svc_check_tier_topology_identical()



*** CID 1370954:  Security best practices violations  (SECURE_TEMP)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-tierd-svc-helper.c:
 157 in glusterd_svc_check_tier_topology_identical()
151 
152 glusterd_svc_build_tierd_volfile_path (volinfo, orgvol,
153 sizeof (orgvol));
154 
155 snprintf (tmpvol, sizeof (tmpvol), "/tmp/g%s-XX", svc_name);
156 
>>> CID 1370954:  Security best practices violations  (SECURE_TEMP)
>>> Calling "mkstemp" without securely setting umask first.
157 tmpfd = mkstemp (tmpvol);
158 if (tmpfd < 0) {
159 gf_msg (this->name, GF_LOG_WARNING, errno,
160 GD_MSG_FILE_OP_FAILED, "Unable to create temp 
file"
161 " %s:(%s)", tmpvol, strerror (errno));
162 goto out;

** CID 1370953:  Security best practices 

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2016-07-20 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

22 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
27 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 22 defect(s)


** CID 1357876:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/rpc/rpc-lib/src/rpc-transport.c: 680 
in rpc_transport_inet_options_build()



*** CID 1357876:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/rpc/rpc-lib/src/rpc-transport.c: 680 
in rpc_transport_inet_options_build()
674 goto out;
675 }
676 
677 ret = dict_set_dynstr (dict, "remote-host", host);
678 if (ret) {
679 GF_FREE (host);
>>> CID 1357876:  Memory - illegal accesses  (USE_AFTER_FREE)
>>> Passing freed pointer "host" as an argument to "_gf_log".
680 gf_log (THIS->name, GF_LOG_WARNING,
681 "failed to set remote-host with %s", host);
682 goto out;
683 }
684 
685 ret = dict_set_int32 (dict, "remote-port", port);

** CID 1357875:  Code maintainability issues  (UNUSED_VALUE)
/xlators/experimental/jbr-server/src/jbr-cg.c: 667 in jbr_lk_perform_local_op()



*** CID 1357875:  Code maintainability issues  (UNUSED_VALUE)
/xlators/experimental/jbr-server/src/jbr-cg.c: 667 in jbr_lk_perform_local_op()
661 goto out;
662 } else {
663 list_add_tail(>qlinks, 
>aqueue);
664 ++(ictx->active);
665 }
666 UNLOCK(>lock);
>>> CID 1357875:  Code maintainability issues  (UNUSED_VALUE)
>>> Assigning value from "jbr_perform_lk_on_leader(frame, this, fd, cmd, 
>>> flock, xdata)" to "ret" here, but that stored value is overwritten before 
>>> it can be used.
667 ret = jbr_perform_lk_on_leader (frame, this, fd, cmd,
668 flock, xdata);
669 }
670 
671 ret = 0;
672 out:

** CID 1357874:  Insecure data handling  (TAINTED_SCALAR)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-geo-rep.c:
 819 in _fcbk_statustostruct()



*** CID 1357874:  Insecure data handling  (TAINTED_SCALAR)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-geo-rep.c:
 819 in _fcbk_statustostruct()
813 while (isspace (*v))
814 v++;
815 v = gf_strdup (v);
816 if (!v)
817 return -1;
818 
>>> CID 1357874:  Insecure data handling  (TAINTED_SCALAR)
>>> Assigning: "k" = "gf_strdup", which taints "k".
819 k = gf_strdup (resbuf);
820 if (!k) {
821 GF_FREE (v);
822 return -1;
823 }
824 

** CID 1357873:  Security best practices violations  (STRING_OVERFLOW)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-volume-ops.c:
 2159 in glusterd_op_create_volume()



*** CID 1357873:  Security best practices violations  (STRING_OVERFLOW)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-volume-ops.c:
 2159 in glusterd_op_create_volume()
2153 if (ret) {
2154 gf_msg (this->name, GF_LOG_ERROR, 0,
2155 GD_MSG_DICT_GET_FAILED, "Unable to get volume 
name");
2156 goto out;
2157 }
2158 
>>> CID 1357873:  Security best practices violations  (STRING_OVERFLOW)
>>> You might overrun the 261 byte fixed-size string "volinfo->volname" by 
>>> copying "volname" without checking the length.
2159 strncpy (volinfo->volname, volname, strlen (volname));
2160 GF_ASSERT (volinfo->volname);
2161 
2162 ret = dict_get_int32 (dict, "type", >type);
2163 if (ret) {
2164 gf_msg (this->name, GF_LOG_ERROR, 0,

** CID 1357872:  Security best practices violations  (STRING_OVERFLOW)
/home/vijay/workspace/glusterfs/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c:
 3454 in glusterd_import_volinfo()

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2016-06-14 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

125 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
95 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 125 defect(s)


** CID 1356589:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/locks/src/common.c: 
492 in new_posix_lock()



*** CID 1356589:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/locks/src/common.c: 
492 in new_posix_lock()
486 
487 lock->blocking  = blocking;
488 
489 INIT_LIST_HEAD (>list);
490 
491 out:
>>> CID 1356589:  Memory - illegal accesses  (USE_AFTER_FREE)
>>> Using freed pointer "lock".
492 return lock;
493 }
494 
495 
496 /* Delete a lock from the inode's lock list */
497 void

** CID 1356588:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/protocol/client/src/client-rpc-fops.c:
 6164 in client3_3_compound()



*** CID 1356588:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/protocol/client/src/client-rpc-fops.c:
 6164 in client3_3_compound()
6158 goto unwind;
6159 }
6160 
6161 iobref_add (rsphdr_iobref, rsphdr_iobuf);
6162 iobuf_unref (rsphdr_iobuf);
6163 rsphdr = [0];
>>> CID 1356588:  Memory - illegal accesses  (USE_AFTER_FREE)
>>> Dereferencing freed pointer "rsphdr_iobuf".
6164 rsphdr->iov_base = iobuf_ptr (rsphdr_iobuf);
6165 rsphdr->iov_len = iobuf_pagesize (rsphdr_iobuf);
6166 rsphdr_count = 1;
6167 local->iobref = rsp_iobref;
6168 rsphdr_iobuf = NULL;
6169 rsphdr_iobref = NULL;

** CID 1356587:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/protocol/client/src/client-helpers.c:
 1264 in client_handle_fop_requirements()



*** CID 1356587:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/protocol/client/src/client-helpers.c:
 1264 in client_handle_fop_requirements()
1258 iobuf_unref (rsp_iobuf);
1259 
1260 if (*rsp_count + 1 >= MAX_IOVEC) {
1261 op_errno = ENOMEM;
1262 goto out;
1263 }
>>> CID 1356587:  Memory - illegal accesses  (USE_AFTER_FREE)
>>> Dereferencing freed pointer "rsp_iobuf".
1264 rsp_vector[*rsp_count].iov_base = iobuf_ptr 
(rsp_iobuf);
1265 rsp_vector[*rsp_count].iov_len = iobuf_pagesize 
(rsp_iobuf);
1266 rsp_iobuf = NULL;
1267 if (args->size > rsp_vector[*rsp_count].iov_len) {
1268 gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
1269 PC_MSG_NO_MEMORY,

** CID 1356586:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/locks/src/posix.c: 
2857 in new_meta_lock()



*** CID 1356586:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/locks/src/posix.c: 
2857 in new_meta_lock()
2851 GF_FREE (lock);
2852 goto out;
2853 }
2854 
2855 __pl_metalk_ref (lock);
2856 out:
>>> CID 1356586:  Memory - illegal accesses  (USE_AFTER_FREE)
>>> Using freed pointer "lock".
2857 return lock;
2858 }
2859 
2860 int
2861 pl_insert_metalk (pl_inode_t *pl_inode, pl_ctx_t *ctx, pl_meta_lock_t 
*lock)
2862 {

** CID 1356585:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/locks/src/posix.c: 
3796 in gf_lkmig_info_to_posix_lock()



*** CID 1356585:  Memory - illegal accesses  (USE_AFTER_FREE)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/locks/src/posix.c: 
3796 in gf_lkmig_info_to_posix_lock()
3790 lock->client_pid = lmi->flock.l_pid;
3791 lock->owner  = lmi->flock.l_owner;
3792 
3793 INIT_LIST_HEAD (>list);

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2016-02-21 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

71 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
76 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 71 defect(s)


** CID 1351709:(USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 
in ec_writev_start()
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 
in ec_writev_start()



*** CID 1351709:(USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 
in ec_writev_start()
1374 dict_unref (xdata);
1375 
1376 return;
1377 
1378 out:
1379 if (iobuf != NULL) {
>>> CID 1351709:(USE_AFTER_FREE)
>>> Calling "iobuf_unref" frees pointer "iobuf" which has already been 
>>> freed.
1380 iobuf_unref(iobuf);
1381 }
1382 if (iobref != NULL) {
1383 iobref_unref(iobref);
1384 }
1385 
/data/workspace/gluster/glusterfs/xlators/cluster/ec/src/ec-inode-write.c: 1380 
in ec_writev_start()
1374 dict_unref (xdata);
1375 
1376 return;
1377 
1378 out:
1379 if (iobuf != NULL) {
>>> CID 1351709:(USE_AFTER_FREE)
>>> Passing freed pointer "iobuf" as an argument to "iobuf_unref".
1380 iobuf_unref(iobuf);
1381 }
1382 if (iobref != NULL) {
1383 iobref_unref(iobref);
1384 }
1385 

** CID 1351708:  Memory - illegal accesses  (USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 
6971 in glusterd_friend_remove_cleanup_vols()



*** CID 1351708:  Memory - illegal accesses  (USE_AFTER_FREE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-utils.c: 
6971 in glusterd_friend_remove_cleanup_vols()
6965 GD_MSG_STALE_VOL_REMOVE_FAIL,
6966 "Error deleting stale volume");
6967 goto out;
6968 }
6969 }
6970 
>>> CID 1351708:  Memory - illegal accesses  (USE_AFTER_FREE)
>>> Passing freed pointer "volinfo" as an argument to 
>>> "glusterd_friend_contains_vol_bricks".
6971 if (!glusterd_friend_contains_vol_bricks (volinfo,
6972   MY_UUID)) {
6973 /*Stop snapd daemon service if snapd daemon is 
running*/
6974 if (!volinfo->is_snap_volume) {
6975 svc = &(volinfo->snapd.svc);
6976 ret = svc->stop (svc, SIGTERM);

** CID 1351707:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/storage/posix/src/posix.c: 1898 in 
posix_unlink()



*** CID 1351707:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/storage/posix/src/posix.c: 1898 in 
posix_unlink()
1892 op_errno = errno;
1893 gf_msg (this->name, GF_LOG_ERROR, errno,
1894 P_MSG_FSTAT_FAILED, "post operation "
1895 "fstat failed on fd=%d", fd);
1896 goto out;
1897 }
>>> CID 1351707:  Code maintainability issues  (UNUSED_VALUE)
>>> Assigning value from "posix_set_iatt_in_dict(unwind_dict, )" to 
>>> "op_ret" here, but that stored value is overwritten before it can be used.
1898 op_ret = posix_set_iatt_in_dict (unwind_dict, 
);
1899 }
1900 
1901 op_ret = posix_pstat (this, loc->pargfid, par_path, 
);
1902 if (op_ret == -1) {
1903 op_errno = errno;

** CID 1351706:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-quota.c: 
1528 in glusterd_op_quota()



*** CID 1351706:  Code maintainability issues  (UNUSED_VALUE)
/data/workspace/gluster/glusterfs/xlators/mgmt/glusterd/src/glusterd-quota.c: 
1528 in glusterd_op_quota()
1522 gf_msg (this->name, GF_LOG_ERROR, 0,
1523 GD_MSG_VOLFILE_CREATE_FAIL, "Unable to 
re-create "
1524

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2015-10-03 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

137 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
171 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 137 defect(s)


** CID 1325650:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/changelog/src/changelog-helpers.c:
 1975 in resolve_pargfid_to_path()



*** CID 1325650:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/changelog/src/changelog-helpers.c:
 1975 in resolve_pargfid_to_path()
1969 
1970 pgfidstr = strtok_r (linkname + 
strlen("../../00/00/"), "/",
1971  );
1972 dir_name = strtok_r (NULL, "/", );
1973 
1974 snprintf (result, PATH_MAX, "%s/%s", dir_name, 
pre_dir_name);
>>> CID 1325650:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
>>> Calling strncpy with a maximum size argument of 4096 bytes on 
>>> destination array "pre_dir_name" of size 4096 bytes might leave the 
>>> destination string unterminated.
1975 strncpy (pre_dir_name, result, sizeof(pre_dir_name));
1976 
1977 gf_uuid_parse (pgfidstr, tmp_gfid);
1978 gf_uuid_copy (pargfid, tmp_gfid);
1979 }
1980 

** CID 1325649:  Error handling issues  (CHECKED_RETURN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/storage/posix/src/posix.c: 
4505 in posix_fsetxattr()



*** CID 1325649:  Error handling issues  (CHECKED_RETURN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/storage/posix/src/posix.c: 
4505 in posix_fsetxattr()
4499 gf_msg (this->name, GF_LOG_WARNING, op_errno, 
P_MSG_PFD_NULL,
4500 "pfd is NULL from fd=%p", fd);
4501 goto out;
4502 }
4503 _fd = pfd->fd;
4504 
>>> CID 1325649:  Error handling issues  (CHECKED_RETURN)
>>> Calling "posix_fdstat" without checking return value (as is done 
>>> elsewhere 20 out of 21 times).
4505 posix_fdstat (this, pfd->fd, );
4506 
4507 dict_del (dict, GFID_XATTR_KEY);
4508 dict_del (dict, GF_XATTR_VOL_ID_KEY);
4509 
4510 filler.fdnum = _fd;

** CID 1325648:  Error handling issues  (CHECKED_RETURN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:
 1319 in afr_selfheal_do()



*** CID 1325648:  Error handling issues  (CHECKED_RETURN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/cluster/afr/src/afr-self-heal-common.c:
 1319 in afr_selfheal_do()
1313gf_boolean_t  metadata_selfheal = _gf_false;
1314gf_boolean_t  entry_selfheal= _gf_false;
1315 afr_private_t *priv= NULL;
1316 gf_boolean_t dataheal_enabled   = _gf_false;
1317 
1318 priv = this->private;
>>> CID 1325648:  Error handling issues  (CHECKED_RETURN)
>>> Calling "gf_string2boolean" without checking return value (as is done 
>>> elsewhere 81 out of 84 times).
1319 gf_string2boolean (priv->data_self_heal, _enabled);
1320 
1321ret = afr_selfheal_unlocked_inspect (frame, this, gfid, ,
1322 _selfheal,
1323 _selfheal,
1324 _selfheal);

** CID 1325647:  Error handling issues  (CHECKED_RETURN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/marker/src/marker.c: 
1156 in marker_rename_unwind()



*** CID 1325647:  Error handling issues  (CHECKED_RETURN)
/home/vijay/workspace/glusterfs/glusterfs/xlators/features/marker/src/marker.c: 
1156 in marker_rename_unwind()
1150 
1151 if (local->stub != NULL) {
1152 /* Remove contribution node from in-memory even if
1153  * remove-xattr has failed as the rename is already 
performed
1154  * if local->stub is set, which means rename was 
sucessful
1155  */
>>> CID 1325647:  Error handling issues  (CHECKED_RETURN)
>>> Calling "mq_inode_ctx_get" without checking return value (as is done 
>>> elsewhere 11 out of 13 times).
1156 mq_inode_ctx_get 

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2015-04-20 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

1 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
11 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)


** CID 1295093:  Integer handling issues  (NO_EFFECT)
/libglusterfs/src/common-utils.c: 1525 in gf_string2bytesize_range()



*** CID 1295093:  Integer handling issues  (NO_EFFECT)
/libglusterfs/src/common-utils.c: 1525 in gf_string2bytesize_range()
1519 if ((max - value)  0) {
1520 errno = ERANGE;
1521 return -1;
1522 }
1523 *n = (uint64_t) value;
1524 } else {
 CID 1295093:  Integer handling issues  (NO_EFFECT)
 This less-than-zero comparison of an unsigned value is never true. max 
 - int_value  0UL.
1525 if ((max - int_value)  0) {
1526 errno = ERANGE;
1527 return -1;
1528 }
1529 *n = int_value;
1530 }



To view the defects in Coverity Scan visit, 
https://scan.coverity.com/projects/987?tab=overview

To manage Coverity Scan email notifications for gluster-devel@gluster.org, 
click 
https://scan.coverity.com/subscriptions/edit?email=gluster-devel%40gluster.orgtoken=7dffab14bc5a7180e75b0d047539f148
 .

___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2015-04-09 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

5 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
33 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 5 of 5 defect(s)


** CID 1293504:(CHECKED_RETURN)
/xlators/mgmt/glusterd/src/glusterd-volgen.c:  in 
volume_volgen_graph_build_clusters_tier()
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3334 in 
volume_volgen_graph_build_clusters_tier()



*** CID 1293504:(CHECKED_RETURN)
/xlators/mgmt/glusterd/src/glusterd-volgen.c:  in 
volume_volgen_graph_build_clusters_tier()
3327 hxl = first_of(graph);
3328 
3329 volinfo-type   = GF_CLUSTER_TYPE_TIER;
3330 xl = volgen_graph_add_nolink (graph, cluster/tier, %s,
3331   tier-dht, 0);
3332 gf_asprintf(rule, %s-hot-dht, st_volname);
 CID 1293504:(CHECKED_RETURN)
 Calling xlator_set_option without checking return value (as is done 
 elsewhere 75 out of 81 times).
 xlator_set_option(xl, rule, rule);
3334 xlator_set_option(xl, xattr-name, trusted.tier-gfid);
3335 
3336 ret = volgen_xlator_link (xl, cxl);
3337 ret = volgen_xlator_link (xl, hxl);
3338 
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3334 in 
volume_volgen_graph_build_clusters_tier()
3328 
3329 volinfo-type   = GF_CLUSTER_TYPE_TIER;
3330 xl = volgen_graph_add_nolink (graph, cluster/tier, %s,
3331   tier-dht, 0);
3332 gf_asprintf(rule, %s-hot-dht, st_volname);
 xlator_set_option(xl, rule, rule);
 CID 1293504:(CHECKED_RETURN)
 Calling xlator_set_option without checking return value (as is done 
 elsewhere 75 out of 81 times).
3334 xlator_set_option(xl, xattr-name, trusted.tier-gfid);
3335 
3336 ret = volgen_xlator_link (xl, cxl);
3337 ret = volgen_xlator_link (xl, hxl);
3338 
3339 st_type = GF_CLUSTER_TYPE_TIER;

** CID 1293503:  Null pointer dereferences  (FORWARD_NULL)
/xlators/storage/posix/src/posix.c: 4137 in posix_fgetxattr()



*** CID 1293503:  Null pointer dereferences  (FORWARD_NULL)
/xlators/storage/posix/src/posix.c: 4137 in posix_fgetxattr()
4131 gf_log (this-name, GF_LOG_WARNING,
4132 Failed to set dictionary value for 
%s,
4133 name);
4134 goto done;
4135 }
4136 
 CID 1293503:  Null pointer dereferences  (FORWARD_NULL)
 Passing null pointer name to strncmp, which dereferences it.
4137 if (strncmp (name, GLUSTERFS_GET_OBJECT_SIGNATURE,
4138   strlen (GLUSTERFS_GET_OBJECT_SIGNATURE)) == 0) {
4139 op_ret = posix_fdget_objectsignature (_fd, dict);
4140 if (op_ret  0) {
4141 op_errno = -op_ret;
4142 op_ret = -1;

** CID 1293502:  Null pointer dereferences  (NULL_RETURNS)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3330 in 
volume_volgen_graph_build_clusters_tier()



*** CID 1293502:  Null pointer dereferences  (NULL_RETURNS)
/xlators/mgmt/glusterd/src/glusterd-volgen.c: 3330 in 
volume_volgen_graph_build_clusters_tier()
3324 if (ret == -1)
3325 goto out;
3326 
3327 hxl = first_of(graph);
3328 
3329 volinfo-type   = GF_CLUSTER_TYPE_TIER;
 CID 1293502:  Null pointer dereferences  (NULL_RETURNS)
 Assigning: xl = null return value from volgen_graph_add_nolink.
3330 xl = volgen_graph_add_nolink (graph, cluster/tier, %s,
3331   tier-dht, 0);
3332 gf_asprintf(rule, %s-hot-dht, st_volname);
 xlator_set_option(xl, rule, rule);
3334 xlator_set_option(xl, xattr-name, trusted.tier-gfid);
3335 

** CID 1293501:  Null pointer dereferences  (REVERSE_INULL)
/xlators/storage/posix/src/posix.c: 4148 in posix_fgetxattr()



*** CID 1293501:  Null pointer dereferences  (REVERSE_INULL)
/xlators/storage/posix/src/posix.c: 4148 in posix_fgetxattr()
4142 op_ret = -1;
4143 }
4144 
4145 goto done;
4146   

[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2015-04-01 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

22 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
40 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 22 defect(s)


** CID 1292644:  Insecure data handling  (TAINTED_SCALAR)



*** CID 1292644:  Insecure data handling  (TAINTED_SCALAR)
/glusterfsd/src/glusterfsd.c: 2252 in main()
2246THIS-ctx = ctx;
2247 
2248 ret = glusterfs_ctx_defaults_init (ctx);
2249 if (ret)
2250 goto out;
2251 
 CID 1292644:  Insecure data handling  (TAINTED_SCALAR)
 Passing tainted variable argv to a tainted sink.
2252 ret = parse_cmdline (argc, argv, ctx);
2253 if (ret)
2254 goto out;
2255 cmd = ctx-cmd_args;
2256 if (cmd-print_netgroups) {
2257 /* If this option is set we want to print  verify the 
file,



To view the defects in Coverity Scan visit, 
https://scan.coverity.com/projects/987?tab=overview

To manage Coverity Scan email notifications for gluster-devel@gluster.org, 
click 
https://scan.coverity.com/subscriptions/edit?email=gluster-devel%40gluster.orgtoken=7dffab14bc5a7180e75b0d047539f148
 .

___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2015-03-25 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

33 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
9 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 33 defect(s)


** CID 1291734:  Error handling issues  (CHECKED_RETURN)
/xlators/cluster/dht/src/tier.c: 451 in tier_build_migration_qfile()



*** CID 1291734:  Error handling issues  (CHECKED_RETURN)
/xlators/cluster/dht/src/tier.c: 451 in tier_build_migration_qfile()
445 {
446 gfdb_time_t current_time;
447 _gfdb_brick_dict_info_t gfdb_brick_dict_info;
448 gfdb_time_t time_in_past;
449 int ret = -1;
450 
 CID 1291734:  Error handling issues  (CHECKED_RETURN)
 Calling remove((is_promotion ? /var/run/gluster/promotequeryfile : 
 /var/run/gluster/demotequeryfile)) without checking return value. This 
 library function may fail and return an error code.
451 remove (GET_QFILE_PATH (is_promotion));
452 time_in_past.tv_sec = args-freq_time;
453 time_in_past.tv_usec = 0;
454 if (gettimeofday (current_time, NULL) == -1) {
455 gf_log (args-this-name, GF_LOG_ERROR,
456 Failed to get current timen);



To view the defects in Coverity Scan visit, 
https://scan.coverity.com/projects/987?tab=overview

To manage Coverity Scan email notifications for gluster-devel@gluster.org, 
click 
https://scan.coverity.com/subscriptions/edit?email=gluster-devel%40gluster.orgtoken=7dffab14bc5a7180e75b0d047539f148
 .

___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] New Defects reported by Coverity Scan for gluster/glusterfs

2015-03-05 Thread scan-admin

Hi,

Please find the latest report on new defect(s) introduced to gluster/glusterfs 
found with Coverity Scan.

200 new defect(s) introduced to gluster/glusterfs found with Coverity Scan.
164 defect(s), reported by Coverity Scan earlier, were marked fixed in the 
recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 200 defect(s)


** CID 1133995:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/xlators/nfs/server/src/mount3.c: 516 in mnt3svc_update_mountlist()



*** CID 1133995:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
/xlators/nfs/server/src/mount3.c: 516 in mnt3svc_update_mountlist()
510 if (ret) {
511 gf_log (GF_MNT, GF_LOG_WARNING, Failed to open '%s',
512 nfs-rmtab);
513 goto free_err;
514 }
515 
 CID 1133995:  Memory - illegal accesses  (BUFFER_SIZE_WARNING)
 Calling strncpy with a maximum size argument of 1024 bytes on 
 destination array me-exname of size 1024 bytes might leave the 
 destination string unterminated.
516 strncpy (me-exname, expname, MNTPATHLEN);
517 
518 INIT_LIST_HEAD (me-mlist);
519 /* Must get the IP or hostname of the client so we
520  * can map it into the mount entry.
521  */



To view the defects in Coverity Scan visit, 
https://scan.coverity.com/projects/987?tab=overview

To manage Coverity Scan email notifications for gluster-devel@gluster.org, 
click 
https://scan.coverity.com/subscriptions/edit?email=gluster-devel%40gluster.orgtoken=7dffab14bc5a7180e75b0d047539f148
 .

___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel


[Gluster-devel] Coverity Scan subscription confirmation

2015-02-03 Thread scan-admin
Hi gluster-devel@gluster.org,


  Your email was added by kshlms...@gmail.com to receive software defect notifications from
  Coverity Scan
  for the gluster/glusterfs project.



  To confirm and activate these notifications,
  click here.



  If you do not wish to receive these emails, you may safely ignore this message.

___
Gluster-devel mailing list
Gluster-devel@gluster.org
http://www.gluster.org/mailman/listinfo/gluster-devel