Bug 1503409

Summary: Missing null check after `iov_dup` in function `error_gen_writev` of xlators/debug/error-gen/src/error-gen.c
Product: [Community] GlusterFS Reporter: Alex CHEN <alexc>
Component: error-genAssignee: bugs <bugs>
Status: CLOSED EOL QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.10CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-20 18:29:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex CHEN 2017-10-18 04:13:48 UTC
Description of problem:


Our code scanner has reported a potential null pointer dereference, in function `error_gen_writev` of xlators/debug/error-gen/src/error-gen.c:

		shortvec = iov_dup(vector, 1);
		shortvec->iov_len /= 2;   // <== use of potential NULL


There are null checks after `iov_dup` in other places, so I thought the programmer had forgotten to add one in above:
https://github.com/gluster/glusterfs/blob/3dce15e10c263e8e071b26046568e0a171a3153d/xlators/cluster/ec/src/ec-inode-read.c#L1292-L1293
https://github.com/gluster/glusterfs/blob/3dce15e10c263e8e071b26046568e0a171a3153d/xlators/cluster/ec/src/ec-inode-read.c#L1226-L1227

Regards,
Alex, SourceBrella Inc.

Comment 1 Alex CHEN 2017-10-27 08:13:43 UTC
could anyone take a quick look and see if it needs a fix?

Comment 2 Shyamsundar 2018-06-20 18:29:50 UTC
This bug reported is against a version of Gluster that is no longer maintained
(or has been EOL'd). See https://www.gluster.org/release-schedule/ for the
versions currently maintained.

As a result this bug is being closed.

If the bug persists on a maintained version of gluster or against the mainline
gluster repository, request that it be reopened and the Version field be marked
appropriately.