Bug 1219214
Summary: | Coverity-detected defect: call to fcntl without checking return value | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Jeff Nelson <jen> | |
Component: | qemu-kvm | Assignee: | Jeff Cody <jcody> | |
Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.6 | CC: | ailan, chayang, juzhang, mkenneth, pbonzini, qzhang, rbalakri, rpacheco, virt-maint | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1219217 (view as bug list) | Environment: | ||
Last Closed: | 2016-01-20 19:47:33 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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1219217 |
Description
Jeff Nelson
2015-05-06 20:29:30 UTC
No, it is not valid. We know that nothing can fail here. IIRC without having the code in front of me this is a F_SETFL. >IIRC without having the code in front of me this is a F_SETFL. It is. >We know that nothing can fail here. fcntl is documented as returning specific error conditions when a given operation is attempted; the F_SETFL command is not specifically mentioned, so these error conditions cannot occur. However, several generic error conditions are documented--without mentioning a command--so it is reasonable to assume they could occur: EACCES or EAGAIN Operation is prohibited by locks held by other processes. EAGAIN The operation is prohibited because the file has been memory-mapped by another process. EBADF fd is not an open file descriptor ENOLCK Too many segment locks open, lock table is full, or a remote locking protocol failed (e.g., locking over NFS). EPERM Attempted to clear the O_APPEND flag on a file that has the append-only attribute set. Out of all these, I'd be most concerned about ENOLCK (given that this is in a glusterfs function). Are you sure that nothing can fail here? The file descriptor is a pipe that has been just opened, so it cannot be any of the above. |