Bug 887010 (CVE-2012-5638)

Summary: CVE-2012-5638 sanlock world writable /var/log/sanlock.log
Product: [Other] Security Response Reporter: Kurt Seifried <kseifried>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aavati, cluster-maint, martin.quinson, mmcallis, rhs-bugs, security-response-team, shaines, ssaha, teigland, vbellur
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-22 02:49:24 UTC Type: ---
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: 849181, 887114    
Bug Blocks: 886367, 887012    
Attachments:
Description Flags
proposed patch none

Description Kurt Seifried 2012-12-13 20:08:03 UTC
The sanlock server creates the /var/log/sanlock.log world writable allowing 
any one on the system to wipe the contents of the log file or to store data 
within the log file (bypassing any quotas applied to their account). The 
affected code is:

src/log.h

int setup_logging(void)
{
        int fd, rv;
        snprintf(logfile_path, PATH_MAX, "%s/%s", SANLK_LOG_DIR,
                 SANLK_LOGFILE_NAME);
        logfile_fp = fopen(logfile_path, "a+");

Comment 2 Martin Quinson 2012-12-24 21:28:22 UTC
Created attachment 668606 [details]
proposed patch

This is just a starting
point, as I was not able to test the patch myself. Also, I used 660 as
permissions to the file, I'm not sure of whether it's sensible or not.

Please review and test before applying.

Comment 3 David Teigland 2013-01-02 16:28:29 UTC
This problem was fixed in bug 849181.

Comment 4 Murray McAllister 2013-03-28 02:03:57 UTC
Acknowledgements:

This issue was discovered by Red Hat.

Comment 5 errata-xmlrpc 2013-03-28 22:28:15 UTC
This issue has been addressed in following products:

  Red Hat Storage 2.0
  Red Hat Storage 2.0 Console
  Native Client for RHEL 5 for Red Hat Storage
  Native Client for RHEL 6 for Red Hat Storage

Via RHSA-2013:0691 https://rhn.redhat.com/errata/RHSA-2013-0691.html