Bug 161594 - drivers/scsi/sg.c: fix check after use
Summary: drivers/scsi/sg.c: fix check after use
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Doug Ledford
QA Contact: Brian Brock
URL: http://marc.theaimsgroup.com/?l=linux...
Whiteboard:
Depends On:
Blocks: RHEL4u8_relnotes
TreeView+ depends on / blocked
 
Reported: 2005-06-24 18:33 UTC by nate.dailey
Modified: 2014-06-10 14:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 19:28:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1024 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 4.8 kernel security and bug fix update 2009-05-18 14:57:26 UTC

Description nate.dailey 2005-06-24 18:33:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

Description of problem:
In drivers/scsi/sg.c: sg_mmap, vma is dereferenced before checking for null. This has been accepted into the latest kernel.org kernel.

--- sg.c.orig   2005-06-23 12:43:22.000000000 -0400
+++ sg.c        2005-06-13 17:32:29.000000000 -0400
@@ -1175,11 +1175,14 @@ static int
 sg_mmap(struct file *filp, struct vm_area_struct *vma)
 {
        Sg_fd *sfp;
-       unsigned long req_sz = vma->vm_end - vma->vm_start;
+       unsigned long req_sz;
        Sg_scatter_hold *rsv_schp;

        if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data)))
                return -ENXIO;
+
+       req_sz = vma->vm_end - vma->vm_start;
+
        SCSI_LOG_TIMEOUT(3, printk("sg_mmap starting, vm_start=%p, len=%d\n",
                                   (void *) vma->vm_start, (int) req_sz));
        if (vma->vm_pgoff)


Version-Release number of selected component (if applicable):
kernel-2.6.9-5.EL

How reproducible:
Didn't try

Steps to Reproduce:


Additional info:

Comment 1 Doug Ledford 2008-10-02 13:48:03 UTC
This obviously got overlooked.

Comment 2 RHEL Program Management 2008-10-02 14:16:34 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 3 Vivek Goyal 2008-10-15 21:13:28 UTC
Committed in 78.14.EL . RPMS are available at http://people.redhat.com/vgoyal/rhel4/

Comment 7 Chris Ward 2009-03-27 14:18:11 UTC
~~ Attention Partners! Snap 1 Released ~~
RHEL 4.8 Snapshot 1 has been released on partners.redhat.com. There should
be a fix present, which addresses this bug. NOTE: there is only a short time
left to test, please test and report back results on this bug
at your earliest convenience.

If you encounter any issues, please set the bug back to the ASSIGNED state and
describe the issues you encountered. If you have found a NEW bug, clone this
bug and describe the issues you encountered. Further questions can be
directed to your Red Hat Partner Manager.

If you have VERIFIED the bug fix. Please select your PartnerID from the
Verified field above. Please leave a comment with your test results details.
Include which arches tested, package version and any applicable logs.

 - Red Hat QE Partner Management

Comment 8 Chris Ward 2009-04-16 15:57:19 UTC
I've confirmed that the patch as provided by the reporter in comment #0 is included in the latest 4.8 kernel (-88.EL)

Comment 9 Chris Ward 2009-04-16 16:07:56 UTC
~~ Attention! Snap 4 Released ~~
RHEL 4.8 Snapshot 4 has been released on partners.redhat.com. There should
be a fix present that addresses this bug. NOTE: there is only a short time
left to test, please test and report back results on this bug ASAP.

The latest kernel build can be obtained here:
http://people.redhat.com/vgoyal/rhel4/

If you encounter any issues, please set the bug back to the ASSIGNED state and
describe the issues you encountered. If you have found a NEW bug, clone this
bug and describe the issues you encountered. Further questions can be
directed to your Red Hat Partner Manager.

If you have VERIFIED the bug fix. Please select your PartnerID from the
Verified field above. Please leave a comment with your test results details.
Include which arches tested, package version and any applicable logs.

Comment 10 nate.dailey 2009-04-16 16:56:49 UTC
Marking this verified by Stratus. I'm not set up to test RHEL 4.8, but I
verified the fix was present in the source RPM and the sources I built from it.

Comment 12 errata-xmlrpc 2009-05-18 19:28:48 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 therefore 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-2009-1024.html

Comment 13 Doug Ledford 2014-06-10 14:50:43 UTC
Clearing stale needinfo on CLOSED bug.


Note You need to log in before you can comment on or make changes to this bug.