Bug 667912 (CVE-2011-0006)

Summary: CVE-2011-0006 kernel: ima: fix add LSM rule bug
Product: [Other] Security Response Reporter: Eugene Teo (Security Response) <eteo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: arozansk, eparis, kernel-mgr, kmcmartin, lwang, tcallawa, vkrizan, wnefal+redhatbugzilla
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: 2015-07-29 13:37:14 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: 667914, 667915    
Bug Blocks:    

Description Eugene Teo (Security Response) 2011-01-07 09:09:53 UTC
If security_filter_rule_init() doesn't return a rule, then not everything is as fine as the return code implies.
    
This bug only occurs when the LSM (eg. SELinux) is disabled at runtime.    

Adding an empty LSM rule causes ima_match_rules() to always succeed, ignoring any remaining rules.
    
     default IMA TCB policy:
      # PROC_SUPER_MAGIC
      dont_measure fsmagic=0x9fa0
      # SYSFS_MAGIC
      dont_measure fsmagic=0x62656572
      # DEBUGFS_MAGIC
      dont_measure fsmagic=0x64626720
      # TMPFS_MAGIC
      dont_measure fsmagic=0x01021994
      # SECURITYFS_MAGIC
      dont_measure fsmagic=0x73636673
    
      < LSM specific rule >
      dont_measure obj_type=var_log_t
    
      measure func=BPRM_CHECK
      measure func=FILE_MMAP mask=MAY_EXEC
      measure func=FILE_CHECK mask=MAY_READ uid=0
    
Thus without the patch, with the boot parameters 'tcb selinux=0', adding the above 'dont_measure obj_type=var_log_t' rule to the default IMA TCB measurement policy, would result in nothing being measured.  The patch prevents the default TCB policy from being replaced.

Upstream commit:
http://git.kernel.org/linus/867c20265459d30a01b021a9c1e81fb4c5832aa9

Introduced in 2.6.30-rc1 4af4662f

Comment 2 Eugene Teo (Security Response) 2011-01-11 08:53:13 UTC
Statement:

The Linux kernel as shipped with Red Hat Enterprise Linux 4, 5, and Red Hat Enterprise MRG are not affected by this issue. A future kernel update in Red Hat Enterprise Linux 6 may address this flaw.

Comment 4 errata-xmlrpc 2011-05-10 18:11:29 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2011:0498 https://rhn.redhat.com/errata/RHSA-2011-0498.html