Re: [Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
On 12/25/2014 12:09 PM, Vijay Bellur wrote: A single bug reported by covscan this time. KP, Kaushal - can you please check this out? http://review.gluster.org/#/c/9338/ should solve it. ~Atin Thanks, Vijay Forwarded Message Subject: New Defects reported by Coverity Scan for GlusterFS Date: Wed, 24 Dec 2014 01:55:19 -0800 From: scan-ad...@coverity.com To: vbel...@redhat.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. 1 new defect(s) introduced to GlusterFS found with Coverity Scan. 14 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 1260432: Out-of-bounds access (OVERRUN) /xlators/mgmt/glusterd/src/glusterd.c: 1323 in glusterd_stop_uds_listener() *** CID 1260432: Out-of-bounds access (OVERRUN) /xlators/mgmt/glusterd/src/glusterd.c: 1323 in glusterd_stop_uds_listener() 1317 (void) rpcsvc_unregister_notify (conf-uds_rpc, 1318 glusterd_uds_rpcsvc_notify, 1319 this); 1320 1321 sock_data = dict_get (this-options, glusterd-sockfile); 1322 if (!sock_data) { CID 1260432: Out-of-bounds access (OVERRUN) Overrunning array sockfile of 109 bytes by passing it to a function which accesses it at byte offset 4095 using argument 4096UL. 1323 strncpy (sockfile, DEFAULT_GLUSTERD_SOCKFILE, PATH_MAX); 1324 } else { 1325 strncpy (sockfile, sock_data-data, PATH_MAX); 1326 } 1327 unlink (sockfile); 1328 To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/987?tab=overview To manage Coverity Scan email notifications for vbel...@redhat.com, click http://scan.coverity.com/subscriptions/edit?email=vbellur%40redhat.comtoken=5b81d38a8ddcb1eaca7a29dec26cbdcc . ___ Gluster-devel mailing list Gluster-devel@gluster.org http://www.gluster.org/mailman/listinfo/gluster-devel ___ Gluster-devel mailing list Gluster-devel@gluster.org http://www.gluster.org/mailman/listinfo/gluster-devel
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
A single bug reported by covscan this time. KP, Kaushal - can you please check this out? Thanks, Vijay Forwarded Message Subject: New Defects reported by Coverity Scan for GlusterFS Date: Wed, 24 Dec 2014 01:55:19 -0800 From: scan-ad...@coverity.com To: vbel...@redhat.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. 1 new defect(s) introduced to GlusterFS found with Coverity Scan. 14 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 1260432: Out-of-bounds access (OVERRUN) /xlators/mgmt/glusterd/src/glusterd.c: 1323 in glusterd_stop_uds_listener() *** CID 1260432: Out-of-bounds access (OVERRUN) /xlators/mgmt/glusterd/src/glusterd.c: 1323 in glusterd_stop_uds_listener() 1317 (void) rpcsvc_unregister_notify (conf-uds_rpc, 1318 glusterd_uds_rpcsvc_notify, 1319 this); 1320 1321 sock_data = dict_get (this-options, glusterd-sockfile); 1322 if (!sock_data) { CID 1260432: Out-of-bounds access (OVERRUN) Overrunning array sockfile of 109 bytes by passing it to a function which accesses it at byte offset 4095 using argument 4096UL. 1323 strncpy (sockfile, DEFAULT_GLUSTERD_SOCKFILE, PATH_MAX); 1324 } else { 1325 strncpy (sockfile, sock_data-data, PATH_MAX); 1326 } 1327 unlink (sockfile); 1328 To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/987?tab=overview To manage Coverity Scan email notifications for vbel...@redhat.com, click http://scan.coverity.com/subscriptions/edit?email=vbellur%40redhat.comtoken=5b81d38a8ddcb1eaca7a29dec26cbdcc . ___ Gluster-devel mailing list Gluster-devel@gluster.org http://www.gluster.org/mailman/listinfo/gluster-devel
Re: [Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
Hi All, Shall we set a goal for ourselves to be Coverity Scan clean by GlusterFS 3.7? I think fixing problems reported in the incremental reports here would be a good way of keeping the number of static analysis defects in control. It would be great if developers who checked in code recently to the files mentioned in these reports pay attention to the results. Thanks, Vijay On 11/28/2014 12:37 PM, Lalatendu Mohanty wrote: Guideline for fixing Coverity issues : http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Forwarded Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Thu, 27 Nov 2014 12:31:06 -0800 From: scan-ad...@coverity.com To: l...@redhat.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. 13 new defect(s) introduced to GlusterFS found with Coverity Scan. 97 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 13 of 13 defect(s) ** CID 1256178: Logically dead code (DEADCODE) /api/src/glfs.c: 153 in glusterfs_ctx_defaults_init() ** CID 1256180: Logically dead code (DEADCODE) /api/src/glfs.c: 161 in glusterfs_ctx_defaults_init() ** CID 1256176: Logically dead code (DEADCODE) /glusterfsd/src/glusterfsd.c: 1426 in glusterfs_ctx_defaults_init() ** CID 1256179: Dereference after null check (FORWARD_NULL) /xlators/nfs/server/src/mount3.c: 1082 in mnt3_readlink_cbk() ** CID 1256177: Explicit null dereferenced (FORWARD_NULL) /api/src/glfs-fops.c: 702 in pub_glfs_preadv_async() ** CID 1256175: Array compared against 0 (NO_EFFECT) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 2433 in glusterd_lvm_snapshot_remove() /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 2433 in glusterd_lvm_snapshot_remove() ** CID 1256173: Thread deadlock (ORDER_REVERSAL) /xlators/cluster/ec/src/ec-common.c: 1335 in ec_unlock_timer_add() ** CID 1256174: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd.c: 287 in glusterd_dump_peer() ** CID 1256172: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd.c: 330 in glusterd_dump_peer_rpcstat() ** CID 1256171: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-handshake.c: 279 in build_volfile_path() ** CID 1238183: Missing break in switch (MISSING_BREAK) /xlators/mgmt/glusterd/src/glusterd-rebalance.c: 577 in glusterd_op_stage_rebalance() ** CID 1228602: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mount/fuse/src/fuse-bridge.c: 4843 in fuse_thread_proc() ** CID 1228603: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() *** CID 1256178: Logically dead code (DEADCODE) /api/src/glfs.c: 153 in glusterfs_ctx_defaults_init() 147 148 pthread_mutex_init ((ctx-lock), NULL); 149 150 ret = 0; 151 err: 152 if (ret pool) { CID 1256178: Logically dead code (DEADCODE) Execution cannot reach this statement if (pool-frame_mem_pool) 153 if (pool-frame_mem_pool) 154 mem_pool_destroy (pool-frame_mem_pool); 155 if (pool-stack_mem_pool) 156 mem_pool_destroy (pool-stack_mem_pool); 157 GF_FREE (pool); 158 } *** CID 1256180: Logically dead code (DEADCODE) /api/src/glfs.c: 161 in glusterfs_ctx_defaults_init() 155 if (pool-stack_mem_pool) 156 mem_pool_destroy (pool-stack_mem_pool); 157 GF_FREE (pool); 158 } 159 160 if (ret ctx) { CID 1256180: Logically dead code (DEADCODE) Execution cannot reach this statement if (ctx-stub_mem_pool) m 161 if (ctx-stub_mem_pool) 162 mem_pool_destroy (ctx-stub_mem_pool); 163 if (ctx-dict_pool) 164 mem_pool_destroy (ctx-dict_pool); 165 if (ctx-dict_data_pool) 166 mem_pool_destroy (ctx-dict_data_pool); *** CID 1256176: Logically dead code (DEADCODE)
Re: [Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
On 12/01/2014 12:31 PM, Vijay Bellur wrote: Hi All, Shall we set a goal for ourselves to be Coverity Scan clean by GlusterFS 3.7? I think fixing problems reported in the incremental reports here would be a good way of keeping the number of static analysis defects in control. It would be great if developers who checked in code recently to the files mentioned in these reports pay attention to the results. +1 Thanks, Vijay On 11/28/2014 12:37 PM, Lalatendu Mohanty wrote: Guideline for fixing Coverity issues : http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Forwarded Message Subject: New Defects reported by Coverity Scan for GlusterFS Date: Thu, 27 Nov 2014 12:31:06 -0800 From: scan-ad...@coverity.com To: l...@redhat.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. 13 new defect(s) introduced to GlusterFS found with Coverity Scan. 97 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 13 of 13 defect(s) ** CID 1256178: Logically dead code (DEADCODE) /api/src/glfs.c: 153 in glusterfs_ctx_defaults_init() ** CID 1256180: Logically dead code (DEADCODE) /api/src/glfs.c: 161 in glusterfs_ctx_defaults_init() ** CID 1256176: Logically dead code (DEADCODE) /glusterfsd/src/glusterfsd.c: 1426 in glusterfs_ctx_defaults_init() ** CID 1256179: Dereference after null check (FORWARD_NULL) /xlators/nfs/server/src/mount3.c: 1082 in mnt3_readlink_cbk() ** CID 1256177: Explicit null dereferenced (FORWARD_NULL) /api/src/glfs-fops.c: 702 in pub_glfs_preadv_async() ** CID 1256175: Array compared against 0 (NO_EFFECT) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 2433 in glusterd_lvm_snapshot_remove() /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 2433 in glusterd_lvm_snapshot_remove() ** CID 1256173: Thread deadlock (ORDER_REVERSAL) /xlators/cluster/ec/src/ec-common.c: 1335 in ec_unlock_timer_add() ** CID 1256174: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd.c: 287 in glusterd_dump_peer() ** CID 1256172: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd.c: 330 in glusterd_dump_peer_rpcstat() ** CID 1256171: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-handshake.c: 279 in build_volfile_path() ** CID 1238183: Missing break in switch (MISSING_BREAK) /xlators/mgmt/glusterd/src/glusterd-rebalance.c: 577 in glusterd_op_stage_rebalance() ** CID 1228602: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mount/fuse/src/fuse-bridge.c: 4843 in fuse_thread_proc() ** CID 1228603: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() *** CID 1256178: Logically dead code (DEADCODE) /api/src/glfs.c: 153 in glusterfs_ctx_defaults_init() 147 148 pthread_mutex_init ((ctx-lock), NULL); 149 150 ret = 0; 151 err: 152 if (ret pool) { CID 1256178: Logically dead code (DEADCODE) Execution cannot reach this statement if (pool-frame_mem_pool) 153 if (pool-frame_mem_pool) 154 mem_pool_destroy (pool-frame_mem_pool); 155 if (pool-stack_mem_pool) 156 mem_pool_destroy (pool-stack_mem_pool); 157 GF_FREE (pool); 158 } *** CID 1256180: Logically dead code (DEADCODE) /api/src/glfs.c: 161 in glusterfs_ctx_defaults_init() 155 if (pool-stack_mem_pool) 156 mem_pool_destroy (pool-stack_mem_pool); 157 GF_FREE (pool); 158 } 159 160 if (ret ctx) { CID 1256180: Logically dead code (DEADCODE) Execution cannot reach this statement if (ctx-stub_mem_pool) m 161 if (ctx-stub_mem_pool) 162 mem_pool_destroy (ctx-stub_mem_pool); 163 if (ctx-dict_pool) 164 mem_pool_destroy (ctx-dict_pool); 165 if (ctx-dict_data_pool) 166 mem_pool_destroy (ctx-dict_data_pool); *** CID 1256176: Logically dead code (DEADCODE) /glusterfsd/src/glusterfsd.c: 1426
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
Guideline for fixing Coverity issues : http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Forwarded Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Thu, 27 Nov 2014 12:31:06 -0800 From: scan-ad...@coverity.com To: l...@redhat.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. 13 new defect(s) introduced to GlusterFS found with Coverity Scan. 97 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 13 of 13 defect(s) ** CID 1256178: Logically dead code (DEADCODE) /api/src/glfs.c: 153 in glusterfs_ctx_defaults_init() ** CID 1256180: Logically dead code (DEADCODE) /api/src/glfs.c: 161 in glusterfs_ctx_defaults_init() ** CID 1256176: Logically dead code (DEADCODE) /glusterfsd/src/glusterfsd.c: 1426 in glusterfs_ctx_defaults_init() ** CID 1256179: Dereference after null check (FORWARD_NULL) /xlators/nfs/server/src/mount3.c: 1082 in mnt3_readlink_cbk() ** CID 1256177: Explicit null dereferenced (FORWARD_NULL) /api/src/glfs-fops.c: 702 in pub_glfs_preadv_async() ** CID 1256175: Array compared against 0 (NO_EFFECT) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 2433 in glusterd_lvm_snapshot_remove() /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 2433 in glusterd_lvm_snapshot_remove() ** CID 1256173: Thread deadlock (ORDER_REVERSAL) /xlators/cluster/ec/src/ec-common.c: 1335 in ec_unlock_timer_add() ** CID 1256174: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd.c: 287 in glusterd_dump_peer() ** CID 1256172: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd.c: 330 in glusterd_dump_peer_rpcstat() ** CID 1256171: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-handshake.c: 279 in build_volfile_path() ** CID 1238183: Missing break in switch (MISSING_BREAK) /xlators/mgmt/glusterd/src/glusterd-rebalance.c: 577 in glusterd_op_stage_rebalance() ** CID 1228602: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mount/fuse/src/fuse-bridge.c: 4843 in fuse_thread_proc() ** CID 1228603: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 2131 in glusterd_readin_file() *** CID 1256178: Logically dead code (DEADCODE) /api/src/glfs.c: 153 in glusterfs_ctx_defaults_init() 147 148 pthread_mutex_init ((ctx-lock), NULL); 149 150 ret = 0; 151 err: 152 if (ret pool) { CID 1256178: Logically dead code (DEADCODE) Execution cannot reach this statement if (pool-frame_mem_pool) 153 if (pool-frame_mem_pool) 154 mem_pool_destroy (pool-frame_mem_pool); 155 if (pool-stack_mem_pool) 156 mem_pool_destroy (pool-stack_mem_pool); 157 GF_FREE (pool); 158 } *** CID 1256180: Logically dead code (DEADCODE) /api/src/glfs.c: 161 in glusterfs_ctx_defaults_init() 155 if (pool-stack_mem_pool) 156 mem_pool_destroy (pool-stack_mem_pool); 157 GF_FREE (pool); 158 } 159 160 if (ret ctx) { CID 1256180: Logically dead code (DEADCODE) Execution cannot reach this statement if (ctx-stub_mem_pool) m 161 if (ctx-stub_mem_pool) 162 mem_pool_destroy (ctx-stub_mem_pool); 163 if (ctx-dict_pool) 164 mem_pool_destroy (ctx-dict_pool); 165 if (ctx-dict_data_pool) 166 mem_pool_destroy (ctx-dict_data_pool); *** CID 1256176: Logically dead code (DEADCODE) /glusterfsd/src/glusterfsd.c: 1426 in glusterfs_ctx_defaults_init() 1420 lim.rlim_max = RLIM_INFINITY; 1421 setrlimit (RLIMIT_CORE, lim); 1422 1423 ret = 0; 1424 out: 1425 CID 1256176: Logically dead code (DEADCODE) Execution cannot reach this expression ctx inside statement if (ret ctx) { if (ctx 1426 if (ret ctx) { 1427 if (ctx-pool) { 1428
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
To fix these Coverity issues , please check the below link for guidelines: http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Original Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Mon, 04 Aug 2014 02:31:28 -0700 From: scan-ad...@coverity.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. Defect(s) Reported-by: Coverity Scan Showing 3 of 3 defect(s) ** CID 1229877: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4061 in glusterd_add_brick_to_snap_volume() /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4062 in glusterd_add_brick_to_snap_volume() /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4049 in glusterd_add_brick_to_snap_volume() /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4050 in glusterd_add_brick_to_snap_volume() ** CID 1229876: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-utils.c: 13482 in glusterd_update_mntopts() /xlators/mgmt/glusterd/src/glusterd-utils.c: 13481 in glusterd_update_mntopts() ** CID 1229878: Time of check time of use (TOCTOU) /xlators/features/changelog/lib/src/gf-changelog.c: 475 in gf_changelog_register() *** CID 1229877: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4061 in glusterd_add_brick_to_snap_volume() 4055 4056 snprintf (key, sizeof(key) - 1, vol%PRId64.mnt_opts%d, volcount, 4057 brick_count); 4058 ret = dict_get_str (dict, key, value); 4059 if (!ret) { 4060 /* Update the mnt_opts in original brickinfo as well */ CID 1229877: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 1024 byte fixed-size string original_brickinfo-mnt_opts by copying value without checking the length. 4061 strcpy (original_brickinfo-mnt_opts, value); 4062 strcpy (snap_brickinfo-mnt_opts, value); 4063 } else { 4064 if (is_origin_glusterd (dict) == _gf_true) 4065 add_missed_snap = _gf_true; 4066 } /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4062 in glusterd_add_brick_to_snap_volume() 4056 snprintf (key, sizeof(key) - 1, vol%PRId64.mnt_opts%d, volcount, 4057 brick_count); 4058 ret = dict_get_str (dict, key, value); 4059 if (!ret) { 4060 /* Update the mnt_opts in original brickinfo as well */ 4061 strcpy (original_brickinfo-mnt_opts, value); CID 1229877: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 1024 byte fixed-size string snap_brickinfo-mnt_opts by copying value without checking the length. 4062 strcpy (snap_brickinfo-mnt_opts, value); 4063 } else { 4064 if (is_origin_glusterd (dict) == _gf_true) 4065 add_missed_snap = _gf_true; 4066 } 4067 /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4049 in glusterd_add_brick_to_snap_volume() 4043 4044 snprintf (key, sizeof(key) - 1, vol%PRId64.fstype%d, volcount, 4045 brick_count); 4046 ret = dict_get_str (dict, key, value); 4047 if (!ret) { 4048 /* Update the fstype in original brickinfo as well */ CID 1229877: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 255 byte fixed-size string original_brickinfo-fstype by copying value without checking the length. 4049 strcpy (original_brickinfo-fstype, value); 4050 strcpy (snap_brickinfo-fstype, value); 4051 } else { 4052 if (is_origin_glusterd (dict) == _gf_true) 4053 add_missed_snap = _gf_true; 4054 } /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 4050 in glusterd_add_brick_to_snap_volume() 4044 snprintf (key, sizeof(key) - 1, vol%PRId64.fstype%d, volcount, 4045 brick_count); 4046 ret = dict_get_str (dict, key, value); 4047 if (!ret) { 4048 /* Update the fstype in original brickinfo as well */ 4049 strcpy (original_brickinfo-fstype, value); CID 1229877: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 255 byte fixed-size string snap_brickinfo-fstype by copying value without checking the length. 4050 strcpy (snap_brickinfo-fstype, value); 4051 } else { 4052 if (is_origin_glusterd (dict) == _gf_true)
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
To fix these Coverity issues , please check the below link for guidelines: http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Original Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Tue, 22 Jul 2014 07:06:56 -0700 From: scan-ad...@coverity.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. Defect(s) Reported-by: Coverity Scan Showing 7 of 7 defect(s) ** CID 1228599: Logically dead code (DEADCODE) /xlators/mgmt/glusterd/src/glusterd-store.c: 4069 in glusterd_store_retrieve_peers() ** CID 1228598: Logically dead code (DEADCODE) /xlators/mgmt/glusterd/src/glusterd-peer-utils.c: 531 in gd_add_friend_to_dict() ** CID 1228600: Data race condition (MISSING_LOCK) /xlators/cluster/ec/src/ec-data.c: 155 in ec_fop_data_allocate() ** CID 1228601: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/features/snapview-server/src/snapview-server.c: 1660 in svs_add_xattrs_to_dict() ** CID 1228603: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mgmt/glusterd/src/glusterd-utils.c: 1987 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 1987 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 1987 in glusterd_readin_file() /xlators/mgmt/glusterd/src/glusterd-utils.c: 1987 in glusterd_readin_file() ** CID 1228602: Use of untrusted scalar value (TAINTED_SCALAR) /xlators/mount/fuse/src/fuse-bridge.c: 4805 in fuse_thread_proc() ** CID 1124682: Dereference null return value (NULL_RETURNS) /rpc/rpc-lib/src/rpc-drc.c: 502 in rpcsvc_add_op_to_cache() *** CID 1228599: Logically dead code (DEADCODE) /xlators/mgmt/glusterd/src/glusterd-store.c: 4069 in glusterd_store_retrieve_peers() 4063 /* Set first hostname from peerinfo-hostnames to 4064 * peerinfo-hostname 4065 */ 4066 address = list_entry (peerinfo-hostnames.next, 4067 glusterd_peer_hostname_t, hostname_list); 4068 if (!address) { CID 1228599: Logically dead code (DEADCODE) Execution cannot reach this statement ret = -1;. 4069 ret = -1; 4070 goto out; 4071 } 4072 peerinfo-hostname = gf_strdup (address-hostname); 4073 4074 ret = glusterd_friend_add_from_peerinfo (peerinfo, 1, NULL); *** CID 1228598: Logically dead code (DEADCODE) /xlators/mgmt/glusterd/src/glusterd-peer-utils.c: 531 in gd_add_friend_to_dict() 525 */ 526 memset (key, 0, sizeof (key)); 527 snprintf (key, sizeof (key), %s.hostname, prefix); 528 address = list_entry (friend-hostnames, glusterd_peer_hostname_t, 529 hostname_list); 530 if (!address) { CID 1228598: Logically dead code (DEADCODE) Execution cannot reach this statement ret = -1;. 531 ret = -1; 532 gf_log (this-name, GF_LOG_ERROR, Could not retrieve first 533 address for peer); 534 goto out; 535 } 536 ret = dict_set_dynstr_with_alloc (dict, key, address-hostname); *** CID 1228600: Data race condition (MISSING_LOCK) /xlators/cluster/ec/src/ec-data.c: 155 in ec_fop_data_allocate() 149 150 mem_put(fop); 151 152 return NULL; 153 } 154 fop-id = id; CID 1228600: Data race condition (MISSING_LOCK) Accessing fop-refs without holding lock _ec_fop_data.lock. Elsewhere, fop-refs is accessed with _ec_fop_data.lock held 7 out of 8 times. 155 fop-refs = 1; 156 157 fop-flags = flags; 158 fop-minimum = minimum; 159 fop-mask = target; 160 *** CID 1228601: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/features/snapview-server/src/snapview-server.c: 1660 in svs_add_xattrs_to_dict() 1654 GF_VALIDATE_OR_GOTO (this-name, dict, out); 1655 GF_VALIDATE_OR_GOTO (this-name, list, out); 1656 1657 remaining_size = size; 1658 list_offset = 0; 1659 while (remaining_size 0) { CID 1228601: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 4096 byte fixed-size string keybuffer by copying list + list_offset without
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
To fix these Coverity issues , please check the below link for guidelines: http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Original Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Mon, 14 Jul 2014 23:47:00 -0700 From: scan-ad...@coverity.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. Defect(s) Reported-by: Coverity Scan Showing 20 of 23 defect(s) ** CID 1226162: Logically dead code (DEADCODE) /xlators/cluster/ec/src/ec-method.c: 119 in ec_method_decode() ** CID 1226164: Division or modulo by zero (DIVIDE_BY_ZERO) /xlators/cluster/dht/src/dht-selfheal.c: 1068 in dht_selfheal_layout_new_directory() ** CID 1226163: Division or modulo by zero (DIVIDE_BY_ZERO) /xlators/cluster/dht/src/dht-selfheal.c: 1062 in dht_selfheal_layout_new_directory() ** CID 1226165: Null pointer dereference (FORWARD_NULL) /libglusterfs/src/client_t.c: 294 in gf_client_get() /libglusterfs/src/client_t.c: 294 in gf_client_get() ** CID 1226177: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-dir-write.c: 181 in ec_manager_create() ** CID 1226176: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-generic.c: 911 in ec_manager_lookup() ** CID 1226175: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-inode-read.c: 671 in ec_manager_open() ** CID 1226174: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-inode-write.c: 1366 in ec_manager_truncate() ** CID 1226173: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-inode-write.c: 2022 in ec_manager_writev() ** CID 1226172: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-locks.c: 218 in ec_manager_entrylk() ** CID 1226171: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-locks.c: 649 in ec_manager_inodelk() ** CID 1226170: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-locks.c: 1134 in ec_manager_lk() ** CID 1226169: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-inode-read.c: 1239 in ec_manager_readv() ** CID 1226168: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-dir-read.c: 366 in ec_manager_readdir() ** CID 1226167: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-heal.c: 1164 in ec_manager_heal() ** CID 1226166: Missing break in switch (MISSING_BREAK) /xlators/cluster/ec/src/ec-heal.c: 1224 in ec_manager_heal() ** CID 1226180: Data race condition (MISSING_LOCK) /xlators/cluster/ec/src/ec-heal.c: 945 in ec_heal_needs_data_rebuild() ** CID 1226179: Data race condition (MISSING_LOCK) /xlators/cluster/ec/src/ec-heal.c: 94 in ec_heal_lookup_resume() ** CID 1226178: Data race condition (MISSING_LOCK) /xlators/cluster/ec/src/ec-heal.c: 93 in ec_heal_lookup_resume() ** CID 1226181: Thread deadlock (ORDER_REVERSAL) /xlators/cluster/ec/src/ec-heal.c: 458 in ec_heal_init() *** CID 1226162: Logically dead code (DEADCODE) /xlators/cluster/ec/src/ec-method.c: 119 in ec_method_decode() 113 } 114 k = 0; 115 for (i = 0; i columns; i++) 116 { 117 while ((mask 1) != 0) 118 { CID 1226162: Logically dead code (DEADCODE) Execution cannot reach this statement k++;. 119 k++; 120 mask = 1; 121 } 122 mtx[k][columns - 1] = 1; 123 for (j = columns - 1; j 0; j--) 124 { *** CID 1226164: Division or modulo by zero (DIVIDE_BY_ZERO) /xlators/cluster/dht/src/dht-selfheal.c: 1068 in dht_selfheal_layout_new_directory() 1062 chunk = ((unsigned long) 0x) / total_size; 1063 gf_log (this-name, GF_LOG_INFO, 1064 chunk size = 0x / %u = 0x%x, 1065 total_size, chunk); 1066 } 1067 else { CID 1226164: Division or modulo by zero (DIVIDE_BY_ZERO) In expression 4294967295UL / bricks_used, division by expression bricks_used which may be zero has undefined behavior. 1068 chunk = ((unsigned long) 0x) / bricks_used; 1069 } 1070 1071 start_subvol = dht_selfheal_layout_alloc_start (this, loc, layout); 1072 1073 /* clear out the range, as we are re-computing here */ *** CID 1226163: Division or modulo by zero (DIVIDE_BY_ZERO) /xlators/cluster/dht/src/dht-selfheal.c: 1062 in
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
FYI, To fix these Coverity issues , please check the below link for how to and guidelines: http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Original Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Sun, 15 Jun 2014 23:52:47 -0700 From: scan-ad...@coverity.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. Defect(s) Reported-by: Coverity Scan Showing 8 of 8 defect(s) ** CID 1223039: Dereference after null check (FORWARD_NULL) /xlators/features/changelog/src/changelog.c: 2057 in init() ** CID 1223041: Data race condition (MISSING_LOCK) /xlators/features/snapview-server/src/snapview-server.c: 2768 in init() ** CID 1223040: Data race condition (MISSING_LOCK) /xlators/features/snapview-server/src/snapview-server.c: 2770 in init() ** CID 1223046: Resource leak (RESOURCE_LEAK) /xlators/features/snapview-server/src/snapview-server.c: 378 in mgmt_get_snapinfo_cbk() ** CID 1223045: Resource leak (RESOURCE_LEAK) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 3826 in glusterd_update_fstype() ** CID 1223044: Resource leak (RESOURCE_LEAK) /xlators/mgmt/glusterd/src/glusterd-snapshot.c: 5503 in glusterd_snapshot_config_commit() ** CID 1223043: Resource leak (RESOURCE_LEAK) /xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 1497 in _get_slave_status() ** CID 1223042: Resource leak (RESOURCE_LEAK) /xlators/mgmt/glusterd/src/glusterd-geo-rep.c: 1035 in _get_status_mst_slv() *** CID 1223039: Dereference after null check (FORWARD_NULL) /xlators/features/changelog/src/changelog.c: 2057 in init() 2051 GF_FREE (priv-changelog_brick); 2052 GF_FREE (priv-changelog_dir); 2053 if (cond_lock_init) 2054 changelog_pthread_destroy (priv); 2055 GF_FREE (priv); 2056 } CID 1223039: Dereference after null check (FORWARD_NULL) Dereferencing null pointer this. 2057 this-private = NULL; 2058 } else 2059 this-private = priv; 2060 2061 return ret; 2062 } *** CID 1223041: Data race condition (MISSING_LOCK) /xlators/features/snapview-server/src/snapview-server.c: 2768 in init() 2762 goto out; 2763 2764 this-private = priv; 2765 2766 GF_OPTION_INIT (volname, priv-volname, str, out); 2767 pthread_mutex_init ((priv-snaplist_lock), NULL); CID 1223041: Data race condition (MISSING_LOCK) Accessing priv-is_snaplist_done without holding lock svs_private.snaplist_lock. Elsewhere, priv-is_snaplist_done is accessed with svs_private.snaplist_lock held 2 out of 2 times. 2768 priv-is_snaplist_done = 0; 2769 priv-num_snaps = 0; 2770 snap_worker_resume = _gf_false; 2771 2772 /* get the list of snaps first to return to client xlator */ 2773 ret = svs_get_snapshot_list (this); *** CID 1223040: Data race condition (MISSING_LOCK) /xlators/features/snapview-server/src/snapview-server.c: 2770 in init() 2764 this-private = priv; 2765 2766 GF_OPTION_INIT (volname, priv-volname, str, out); 2767 pthread_mutex_init ((priv-snaplist_lock), NULL); 2768 priv-is_snaplist_done = 0; 2769 priv-num_snaps = 0; CID 1223040: Data race condition (MISSING_LOCK) Accessing snap_worker_resume without holding lock mutex. Elsewhere, snap_worker_resume is accessed with mutex held 3 out of 3 times. 2770 snap_worker_resume = _gf_false; 2771 2772 /* get the list of snaps first to return to client xlator */ 2773 ret = svs_get_snapshot_list (this); 2774 if (ret) { 2775 gf_log (this-name, GF_LOG_ERROR, *** CID 1223046: Resource leak (RESOURCE_LEAK) /xlators/features/snapview-server/src/snapview-server.c: 378 in mgmt_get_snapinfo_cbk() 372 free (rsp.op_errstr); 373 374 if (myframe) 375 SVS_STACK_DESTROY (myframe); 376 377 error_out: CID 1223046: Resource leak (RESOURCE_LEAK) Variable dirents going out of scope leaks the storage it points to. 378 return ret; 379 } 380 381 int 382 svs_get_snapshot_list (xlator_t *this) 383 {
[Gluster-devel] Fwd: New Defects reported by Coverity Scan for GlusterFS
FYI, To fix these Coverity issues , please check the below link for guidelines: http://www.gluster.org/community/documentation/index.php/Fixing_Issues_Reported_By_Tools_For_Static_Code_Analysis#Coverity Thanks, Lala Original Message Subject:New Defects reported by Coverity Scan for GlusterFS Date: Wed, 11 Jun 2014 06:36:17 -0700 From: scan-ad...@coverity.com Hi, Please find the latest report on new defect(s) introduced to GlusterFS found with Coverity Scan. Defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s) ** CID 1222523: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-utils.c: 3728 in gd_import_new_brick_snap_details() /xlators/mgmt/glusterd/src/glusterd-utils.c: 3737 in gd_import_new_brick_snap_details() ** CID 1222524: Structurally dead code (UNREACHABLE) /cli/src/cli-rpc-ops.c: 8796 in gf_cli_snapshot_for_status() *** CID 1222523: Copy into fixed size buffer (STRING_OVERFLOW) /xlators/mgmt/glusterd/src/glusterd-utils.c: 3728 in gd_import_new_brick_snap_details() 3722 snprintf (key, sizeof (key), %s.device_path, prefix); 3723 ret = dict_get_str (dict, key, snap_device); 3724 if (ret) { 3725 gf_log (this-name, GF_LOG_ERROR, %s missing in payload, key); 3726 goto out; 3727 } CID 1222523: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 4096 byte fixed-size string brickinfo-device_path by copying snap_device without checking the length. 3728 strcpy (brickinfo-device_path, snap_device); 3729 3730 memset (key, 0, sizeof (key)); 3731 snprintf (key, sizeof (key), %s.mount_dir, prefix); 3732 ret = dict_get_str (dict, key, mount_dir); 3733 if (ret) { /xlators/mgmt/glusterd/src/glusterd-utils.c: 3737 in gd_import_new_brick_snap_details() 3731 snprintf (key, sizeof (key), %s.mount_dir, prefix); 3732 ret = dict_get_str (dict, key, mount_dir); 3733 if (ret) { 3734 gf_log (this-name, GF_LOG_ERROR, %s missing in payload, key); 3735 goto out; 3736 } CID 1222523: Copy into fixed size buffer (STRING_OVERFLOW) You might overrun the 4096 byte fixed-size string brickinfo-mount_dir by copying mount_dir without checking the length. 3737 strcpy (brickinfo-mount_dir, mount_dir); 3738 3739 out: 3740 return ret; 3741 } 3742 *** CID 1222524: Structurally dead code (UNREACHABLE) /cli/src/cli-rpc-ops.c: 8796 in gf_cli_snapshot_for_status() 8790 dict_unref (snap_dict); 8791 } 8792 } 8793 out: 8794 return ret; 8795 CID 1222524: Structurally dead code (UNREACHABLE) This code cannot be reached: if (ret snap_dict) dic 8796 if (ret snap_dict) 8797 dict_unref (snap_dict); 8798 } 8799 8800 int32_t 8801 gf_cli_snapshot (call_frame_t *frame, xlator_t *this, To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/987?tab=overview To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py ___ Gluster-devel mailing list Gluster-devel@gluster.org http://supercolony.gluster.org/mailman/listinfo/gluster-devel