Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 3 product line. The current stable release is 3.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 137820

Summary: CVE-2004-1057 VM_IO refcount issue
Product: Red Hat Enterprise Linux 3 Reporter: Josh Bressers <bressers>
Component: kernelAssignee: Alan Cox <alan>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 3.0CC: alan, anderson, jparadis, lwoodman, mjc, peterm, petrides, riel, security-response-team, tburke
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=important,public=20041101
Fixed In Version: RHSA-2006-0140 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-19 15:59:13 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:    
Bug Blocks: 168424    
Attachments:
Description Flags
Patch for this issue. none

Comment 1 Josh Bressers 2004-11-01 20:16:56 UTC
Created attachment 106045 [details]
Patch for this issue.

This patch was taken from 

http://www.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.23aa3/00_VM_IO-4

Comment 5 Alan Cox 2005-06-06 18:30:47 UTC
The issue is fairly simple in its basis. When a driver allocates resources and
marks the pages PG_Private (for DMA use) the pages are no longer refcounted.

Now imagine someone doing O_DIRECT dma on an audio mmap and closing the mmap.
Not pretty 8)

The needed fix as far as I can see for RHEL3 is to set VM_IO (ie disallow the
O_DIRECT) in remap_page_range(). We can do that because unlike base 2.4 we
happen to pass the vma into the function.


Comment 10 Alan Cox 2005-06-30 15:54:38 UTC
This is the 2.6 addition (which is like our 2.4 because we pass the vma for Riel mm)

        /*
         * Physically remapped pages are special. Tell the
         * rest of the world about it:
         *   VM_IO tells people not to look at these pages
         *      (accesses can have side effects).
         *   VM_RESERVED tells swapout not to try to touch
         *      this region.
         */
        vma->vm_flags |= VM_IO | VM_RESERVED;


Comment 15 Ernie Petrides 2005-09-15 04:12:28 UTC
A fix for this problem has just been committed to the RHEL3 U7
patch pool this evening (in kernel version 2.4.21-37.2.EL).


Comment 18 Ernie Petrides 2006-01-11 23:32:10 UTC
A fix for this problem has also been committed to the RHEL3 E7
patch pool this evening (in kernel version 2.4.21-37.0.1.EL).


Comment 20 Red Hat Bugzilla 2006-01-19 15:59:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2006-0140.html