Bug 91585

Summary: ioperm security fix is flawed, still uses uninitialized memory
Product: [Retired] Red Hat Linux Reporter: Barry K. Nathan <barryn>
Component: kernelAssignee: Arjan van de Ven <arjanv>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: wtogami
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-03 10:16: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:

Description Barry K. Nathan 2003-05-25 00:50:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030518
Mozilla Firebird/0.6

Description of problem:
The 2.4.20-13.9 backport of the ioperm security fix only copies 1/4th of the
bitmap when it should be copying the whole thing. This still leaves memory
uninitialized, so the original hole is still not completely fixed. Furthermore,
some programs that previously worked (svgalib and FCE Ultra in particular) are
now broken.

See below for links to both a test case and a fix.

Version-Release number of selected component (if applicable):
kernel-2.4.20-13.9

How reproducible:
Sometimes

Steps to Reproduce:
There is a test case in this mailing list post (but ignore the comments about
2.5 also being broken -- it's not, and I corrected myself in a followup):
http://marc.theaimsgroup.com/?l=linux-kernel&m=105367363526877&w=2

Actual Results:  Test case often segfaults when performing inb operation.

(FWIW, FCE Ultra (emulator for Nintendo), when invoked as "fceu", typically
segfaults.)

Expected Results:  Test case should always print "result: " and some number,
when run as root.

(And "fceu" should print command line option help without segfaulting first.)

Additional info:

A possible fix is here:
http://marc.theaimsgroup.com/?l=linux-kernel&m=105368405504595&w=2

(If that's too invasive and you want me to make a simpler patch, feel free to
let me know.)

As you might be able to tell from the URLs above, I already posted about this on
the linux-kernel mailing list (regarding 2.4.21-rc3). I'm filing this report in
Bugzilla because it happens with Red Hat's own kernels too.

Comment 1 Barry K. Nathan 2003-05-26 22:53:36 UTC
FWIW, my patch is now in 2.4.21-rc4.

Comment 2 Arjan van de Ven 2003-06-03 10:16:14 UTC
An errata 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-2003-187.html